美文网首页
在Windows10中安装python3.x

在Windows10中安装python3.x

作者: 冰城已无爱 | 来源:发表于2017-11-21 11:34 被阅读0次

    工作不忙了,所以又开始学习python,现在我受用的是window10 的系统,下面开始进行python3.x的安装。

    首先在官方网站https://www.python.org/下载python安装包,然后根据提示安装python的安装包,切记python安装包的安装地址啊,当时安装没有在意,直接安装到c盘,完全找不到,纠结死我了,如果忘记了安装地址,可以利用搜索查找python的安装地址,如图:

    搜索python安装路径

    需要在电脑配置环境的,在我的电脑—属性—高级系统配置—环境变量—系统变量里的path

    进入环境变量界面

    在出现的编辑环境变量中,点击新建文本中,复制python的安装路劲,再次点击确定,环境就配置成功了。

    复制python安装路径

    利用快捷键,“lWindows+R”—输入cmd",进入命令行,输入:python,显示python的安装版本号,说明安装成功了。

    python显示版本号

    如果未显示以上的图片,可以重新启动计算机,再次进入后台,输入python。可以在开始-python中点击IDLE,进入环境。

    进入IDLE

    在IDLE中输入print “Hello World”,谁知却发生错误:

    >>> print "Hello World"

    SyntaxError: invalid syntax

    而在朋友的机子上测试却运行无误,经查得知这是Python 版本不同所致。朋友用的是2.x版本,而我用的是3.x版本

    正确命令:print("Hello World")

    问题是通过用help命令解决的。输入help(print)就知道print的正确用法了。

    >>> help(print)Help on built-in function print in module builtins:

    print(...)    print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)        Prints the values to a stream, or to sys.stdout by default.    Optional keyword arguments:    file:  a file-like object (stream); defaults to the current sys.stdout.    sep:   string inserted between values, default a space.    end:   string appended after the last value, default a newline.    flush: whether to forcibly flush the stream.

    最后只能说,完美,可以继续使用了python了~~~~~~

    相关文章

      网友评论

          本文标题:在Windows10中安装python3.x

          本文链接:https://www.haomeiwen.com/subject/xfiivxtx.html