Windows

  • 下载安装包:https://www.python.org/downloads/

  • 安装:默认安装路径:C:\python38

  • 配置环境变量:【右键计算机】-->【属性】-->【高级系统设置】-->【高级】-->【环境变量】-->【在系统变量中找到 Path,双击或编辑】-->【添加Python安装目录,如;C:\python38,切记前面有英文标点分号(win10系统变量与win7大体一致)】

win7系统下Python环境变量配置

Linux、Mac

  • 无需安装,原装Python环境

  • ps:可根据选择自行更新

检验环境变量是否配置成功

  • 【win+R/运行】-->【输入cmd,回车或确认】-->【输入python,查看python版本号】-->【如果成功返回版本号则证明python安装成功且python环境配置完成】

python版本号

编写第一个Python程序

# python2.x版本

s = 'Hello Word!'

print s

# python3.x版本

print("Hello Word!")

Python2.x版本说明

  • Let's not play games with semantics. The way I see the situation for 2.7 is  that EOL is January 1st, 2020, and there will be no updates, not even source-only security patches, after that date. Support (from the core devs, the PSF, and python.org) stops completely on that date. If you want support for 2.7 beyond that day you will have to pay a commercial vendor. Of course it's open source so people are also welcome to fork it. But the core devs have toiled long enough, and the 2020 EOL date (an extension from the  originally annouced 2015 EOL!) was announced with sufficient lead time and fanfare that I don't feel bad about stopping to support it at all.

  • 大体之意:不要玩文字游戏了!Python 2.7 的 EOL(停用)日期是 2020 年 1 月 1 日,接下来,将不会有任何更新,也不会再有源码安全补丁。在此日期之后,Python 核心开发者、PSF 和 python.org 将不会提供任何支持。如果你还想获得支持,那得付相关商业费用。当然,它是开源的,所以我们也欢迎大家 fork。我们最初决定 2015 年为 EOL 日期,然后推迟到 2020 年,给大家的时间已经很充足了,核心开发者也辛苦太久了。此外,坦诚地说,我并不觉得停用 Python 2.7 是件坏事。[阅读原文]

不起眼的小广告