Elicipse搭建python開發環境

來源:互聯網
上載者:User

標籤: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開發環境

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.