Python安装的实际应用操作

 如果你在Python安装的实际应用的过程中你有一些关于Python安装中存在的问题,你就可以浏览我们的文章,我们的文章就是对其相关内容的介绍,希望你在看完我们的文章,以后会有所收获。

下载windows版本,下载完成以后,双击打开,然后一步一步安装。

 
 
 
  1. *Python 2.5.2 Windows installer

装好后,启动 Python command line,然后输入:

 
 
 
  1. *Python 2.5.2 Windows installer

如果输出

 
 
 
  1. "Hello World"

那就表明安装成功了。简单的配置:右键我的电脑-属性-高级-环境变量,在path里输入你的python安装位置即可,比java简单的多了。我的是 E:\Python25;应该是找到pythonw.exe的父一级目录。测试:随便建一个文件夹,如在d\code\python下建立一个文本文件,并改名为 hello.py在文本中输入

 
 
 
  1. print "Hello World"

在命令提示符下进入到 d\code\python安装路径下输入python hello.py,直接输入hello.py (必须设置环境变量才可以)程序将会输出Hello World我们看另一个稍微复杂的程序。

 
 
 
  1. integer1=raw_input("enter the first integer:\n")
  2. intinteger1=int(integer1)
  3. integer2=raw_input("enter the second integer:\n")
  4. intinteger2=int(integer2)
  5. sum=integer1+integer2
  6. print "The sum is ",sum

另存为sum.py .执行结果为:

 
 
 
  1. E:\>python e:\python\sum.py
  2. enter the first integer:
  3. 8
  4. enter the second integer:
  5. 11
  6. The sum is 19

以上的文章就是对Python安装的实际应用操作方案的介绍。


标题名称:Python安装的实际应用操作
链接URL:http://www.gydahua.com/article/cccggcc.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流