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安装的实际应用操作方案的介绍。

【编辑推荐】

  1. Python二维数组在创建过程中步骤详解
  2. Python模块中的函数列表介绍
  3. 用Python函数创建字典的实际应用方案
  4. PythonS60手机中搭建手机运行平台的五个步骤
  5. Python字符串中的mapping的功能介绍

 

THE END