標籤:copyright windows default 控制台 python
目錄
安裝Python
python for eclipse外掛程式安裝
配置PyDev外掛程式
測試
安裝Python
從網站上下載最新的版本,從http://python.org/download/下載。安裝過程與其他Windows軟體類似。目前穩定版本為Python 2.7.6和Python 3.3.4。
在Windows命令列中使用Python
如果你想要從Windows命令列調用Python,那麼需要先設定Python環境變數。
對於Windows,點擊控制台->系統->進階->環境變數。在“系統變數”表單中點擊叫做PATH的變數,然後編輯這個變數,把;D:\dev\python2.7.6加到它的結尾。當然,是Python所在的安裝目錄。
測試python環境變數是否設定成功
C:\Users\jiqinlin>pythonPython 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>>
python for eclipse外掛程式安裝
1、下載python for eclipse
python for eclipse,如:org.python.pydev.feature-1.6.3.2010100513.zip
2、解壓pydev外掛程式後,會發現有features、plugins兩個檔案夾,然後把features檔案夾下的檔案移到D:\dev\eclipse\features目錄下,把plugins檔案夾下的檔案移到D:\dev\eclipse\plugins目錄下。
注意:D:\dev\eclipse\為eclipse安裝目錄
3、重啟eclipse,在windows->preferences出現PyDev配置項,表示PyDev外掛程式安裝成功。
配置PyDev外掛程式
在Window菜單中選Preference,
1、windows->preferences->PyDev->Interpreter - Python,New一個Python解譯器,填上解譯器名字和路徑,路徑選相應的python.exe。
650) this.width=650;" src="/e/u261/themes/default/images/spacer.gif" style="background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" alt="spacer.gif" />650) this.width=650;" src="https://s1.51cto.com/wyfs02/M01/8E/39/wKiom1i5AkGiZ3ewAABFu9_bw_s993.png-wh_500x0-wm_3-wmp_4-s_1430639600.png" title="Image.png" alt="wKiom1i5AkGiZ3ewAABFu9_bw_s993.png-wh_50" />
650) this.width=650;" src="/e/u261/themes/default/images/spacer.gif" style="background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" alt="spacer.gif" />
以下幾步Python 3.x必選,Python 2隨意。個人比較習慣Unicode,所以一次性在這兒設定了。
2、General->Editors->Text Editors->Spelling,Encoding改成Other:UTF-8
650) this.width=650;" src="https://s5.51cto.com/wyfs02/M00/8E/39/wKiom1i5Ak-i1dLSAACwOXpz1pA232.png-wh_500x0-wm_3-wmp_4-s_1087976602.png" title="Image (2).png" alt="wKiom1i5Ak-i1dLSAACwOXpz1pA232.png-wh_50" />
3、General->Workspace,Text file encoding改成Other:UTF-8
至此,PyDev的配置就完成了。
測試
File->New->Project,選PyDev下的PyDev Project,Grammer和Interpreter選相應的版本,Finish。
650) this.width=650;" src="/e/u261/themes/default/images/spacer.gif" style="background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" alt="spacer.gif" />650) this.width=650;" src="https://s4.51cto.com/wyfs02/M00/8E/37/wKioL1i5AmaA750-AACixZaB9OU777.png-wh_500x0-wm_3-wmp_4-s_1100704676.png" title="Image (3).png" alt="wKioL1i5AmaA750-AACixZaB9OU777.png-wh_50" />在PyDev Package Explorer的項目上右鍵,New->PyDev Module,隨便寫個名字,Finish。
然後隨便寫幾行代碼,Run在彈出的對話方塊中選擇Python Run,OK
650) this.width=650;" src="/e/u261/themes/default/images/spacer.gif" style="background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" alt="spacer.gif" />
650) this.width=650;" src="https://s1.51cto.com/wyfs02/M02/8E/39/wKiom1i5AnKjisj2AAA9rgar7k8416.png-wh_500x0-wm_3-wmp_4-s_2761766871.png" title="Image (4).png" alt="wKiom1i5AnKjisj2AAA9rgar7k8416.png-wh_50" />
本文出自 “無法長大” 部落格,請務必保留此出處http://tfbaby.blog.51cto.com/3125450/1902936
Elicipse搭建python開發環境