
上QQ阅读APP看书,第一时间看更新
1.1 Python安装
在Python官网下载页面(https://www.python.org/downloads/)选择合适的Python版本,下载后进行安装(或双击本书配套资源ch1文件夹中的python-3.5.4-amd64.exe文件进行安装)。安装时要选择Add Python 3.5 to PATH复选框,如图1.3所示。

图1.3 Python安装界面
下面3种方法都可以判断Python是否安装成功。
(1)在命令行输入命令python-V,查看Python版本,出现如图1.4所示的版本信息,表示Python安装成功。
(2)在命令行输入命令python,进入编程模式(出现>>>提示符),输入print("hello world"),出现如图1.4所示的hello world(要退出编程模式,按Ctrl+C键即可),表示Python安装成功。
(3)右击本书配套资源ch1文件夹中的Python程序文件hello.py,用IDLE打开该文件,按F5键运行程序,出现如图1.5所示的内容,表示Python安装成功。

图1.4 在命令行验证安装是否成功

图1.5 运行程序验证Python安装成功