【实验目的】

1) 掌握windows平台下python2.x解释器安装与配置

【实验原理】

Python编程语言有两个版本:Python2.x与Python3.x。这两个版本互相不兼容,许多初学者因为忽略了这一点而无法执行自己的代码。本实验使用 Python2.x的版本。

【实验环境】

Windows 7/2008系统、python-2.7.10.amd64.msi

【实验步骤】

一、安装Python-2.7

1.1 在C盘下找到Python文件夹,打开后里面有需要的安装包,版本是python-2.7.10.amd64.msi,如图1所示

python使用配置(Python环境配置)(1)

图1

1.2 右击打开python-2.7.10.amd64.msi点击安装,后续点击Next,如图2、图3所示

python使用配置(Python环境配置)(2)

图2

python使用配置(Python环境配置)(3)

图3

1.3 选择安装路径,在C:\Python,后续点击Next,如图4到图7所示

python使用配置(Python环境配置)(4)

图4

python使用配置(Python环境配置)(5)

图5

python使用配置(Python环境配置)(6)

图6

python使用配置(Python环境配置)(7)

图7

二、测试Python工具

2.1 在开始菜单中,找到 Python 2.7 -> IDLE (Python GUI),如图8所示

python使用配置(Python环境配置)(8)

图8

2.2点击IDLE (Python GUI)打开,如图9所示

python使用配置(Python环境配置)(9)

图9

三、配置Python环境变量

3.1 右键点击计算机图标,选择”属性”,进入如下界面,如图10所示

python使用配置(Python环境配置)(10)

图10

3.2 点击高级系统设置,再选择环境变量,如图11所示

python使用配置(Python环境配置)(11)

图11

3.3 在环境变量中找到系统变量中的”Path”变量,点击编辑,如图12所示

python使用配置(Python环境配置)(12)

图12

3.4 在”Path”变量中加上Python的安装路径,如图13所示

图13

3.5 在cmd命令行窗口中验证,如图14、图15所示

python使用配置(Python环境配置)(13)

图14

python使用配置(Python环境配置)(14)

图15

,