Eclipse 與 PyDev

 

 

Eclipse Version:

Kepler Service Release 2

PyDev:

http://pydev.org/download.html

Latest Version: 2.7.0(18 October 2012)

支援:

Eclipse (3.2 to 3.8/4.2)

 


Workspace 與 Project

每一個 Project 都是屬於 Workspace

轉 Workspace:

File->Switch Workspace

當 Cut Project 的 Source Code Folder 到另一個 Workspace 後, 那要重新 import 返才用到

File->Import

 


一般裝方法:

在 Eclipse 內按 Help-> Install New software

按 "Add..."

在 Name: 填上 "pydev" , Location: 填上 "http://pydev.org/updates"

 

zip 安裝方法:

下載 http://sourceforge.net/projects/pydev/files/

放到 X:\eclipse\dropins (E:\eclipse 是 ecilipse 的安裝目錄) 之後 restart eclipse


設定 Python 的 interpreter:

安裝後仍要設定 interpreter

window > preferences > PyDev > Interpreter -> Python Interpreter -> Select "Quick Auto-Config"
(成功安裝才有以上選項)

Forced Builtins

The Forced builtin libs are the libraries that are built-in the interpreter ( such as _builtin_ )

PyDev 會為它們建立 "completions"


First Project

Window -> Open Perspective -> Other... -> Select "PyDev"

Project >> Package >> Module

menu: window > open perspective > other > PyDev

 

# 含有 src 目錄

File > new > PyDev package
right-click it and select New -> PyDev Modul

 

Hotkey:

ctrl+shift+l        # "Show Key Assist"

============================

ctrl+space       # PyDev code-completion

F5                   # refresh it

F9                   # run

Ctrl+F9            # run the unit-tests

ctrl+1               # Quick Fix

ctrl+4               # Add comment box

ctrl+5               # Remove comment box

ctrl+/               # toggle comment

[shitf]+tab        # indent

 

P.S.

* firewall that is blocking communication from the shell.

 



Debugging

 

Ctrl+F10 and select 'Add breakpoint',
F11 Run in Debug mode
Ctrl+F11, the last file ran is re-run

  • F5: Step into
  • F6: Step over
  • F7: Step return
  • F8: Resume execution ( stop on the next breakpoint)

其他 hot key:

  • 'Ctrl+F8' iterates through perspective
  • 'Ctrl+F7' iterates through the views
  • 'Ctrl+F6' iterates through the editors.

 



Uninstalling:

自動 uninstall:

help > about > installation details -> Installed Software tab

zip 包的 Uninstall:

把 dropins/features 及 dropins/plugins 內的以下檔案刪除

org.python.pydev..*

org.python.pydev.*

com.python.pydev.*

刪除

 



參考:

http://pydev.org/manual_101_root.html

 

Creative Commons license icon Creative Commons license icon