今天就跟大家聊聊有關如何進行Python安裝的實際應用操作,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結了以下內容,希望大家根據這篇文章可以有所收獲。
下載windows版本,下載完成以后,雙擊打開,然后一步一步安裝。
*Python 2.5.2 Windows installer
裝好后,啟動 Python command line,然后輸入:
*Python 2.5.2 Windows installer
如果輸出
"Hello World"
那就表明安裝成功了。簡單的配置:右鍵我的電腦-屬性-高級-環境變量,在path里輸入你的python安裝位置即可,比java簡單的多了。我的是 E:\Python25;應該是找到pythonw.exe的父一級目錄。測試:隨便建一個文件夾,如在d\code\python下建立一個文本文件,并改名為 hello.py在文本中輸入
print "Hello World"
在命令提示符下進入到 d\code\python安裝路徑下輸入python hello.py,直接輸入hello.py (必須設置環境變量才可以)程序將會輸出Hello World我們看另一個稍微復雜的程序。
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 .執行結果為:
E:\>python e:\python\sum.py enter the first integer: 8 enter the second integer: 11 The sum is 19
看完上述內容,你們對如何進行Python安裝的實際應用操作有進一步的了解嗎?如果還想了解更多知識或者相關內容,請關注億速云行業資訊頻道,感謝大家的支持。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。