Python安裝的實際應(yīng)用操作
如果你在Python安裝的實際應(yīng)用的過程中你有一些關(guān)于Python安裝中存在的問題,你就可以瀏覽我們的文章,我們的文章就是對其相關(guān)內(nèi)容的介紹,希望你在看完我們的文章,以后會有所收獲。
下載windows版本,下載完成以后,雙擊打開,然后一步一步安裝。
- *Python 2.5.2 Windows installer
裝好后,啟動 Python command line,然后輸入:
- *Python 2.5.2 Windows installer
如果輸出
- "Hello World"
那就表明安裝成功了。簡單的配置:右鍵我的電腦-屬性-高級-環(huán)境變量,在path里輸入你的python安裝位置即可,比java簡單的多了。我的是 E:\Python25;應(yīng)該是找到pythonw.exe的父一級目錄。測試:隨便建一個文件夾,如在d\code\python下建立一個文本文件,并改名為 hello.py在文本中輸入
- print "Hello World"
在命令提示符下進(jìn)入到 d\code\python安裝路徑下輸入python hello.py,直接輸入hello.py (必須設(shè)置環(huán)境變量才可以)程序?qū)敵鯤ello World我們看另一個稍微復(fù)雜的程序。
- integer1=raw_input("enter the first integer:\n")
- intinteger1=int(integer1)
- integer2=raw_input("enter the second integer:\n")
- intinteger2=int(integer2)
- sum=integer1+integer2
- print "The sum is ",sum
另存為sum.py .執(zhí)行結(jié)果為:
- E:\>python e:\python\sum.py
- enter the first integer:
- 8
- enter the second integer:
- 11
- The sum is 19
以上的文章就是對Python安裝的實際應(yīng)用操作方案的介紹。
【編輯推薦】
- Python二維數(shù)組在創(chuàng)建過程中步驟詳解
- Python模塊中的函數(shù)列表介紹
- 用Python函數(shù)創(chuàng)建字典的實際應(yīng)用方案
- PythonS60手機(jī)中搭建手機(jī)運(yùn)行平臺的五個步驟
- Python字符串中的mapping的功能介紹