在Eclipse中调试/运行TurboGears2

 

环境:os:windows server 2003, IDE: eclipse 3.4.0, PyDev 1.5.1

 

在开始之前确保已经安装好pydev

 

1.在eclipse中新建一个python项目。

2.eclipse不能直接创建TG2项目,所以将已用paster建好的TG2项目导入到刚刚新建的那个python项目中

3.将附件中的launch_tg.rar解压后放入跟项目中development.ini相同的目录下。

4.创建新的编译器

       1).在eclipse中按住项目,点右键->PyDev Interpreter,点“click here to configure a interpreter not listd”

 

        2).新建一个Interpreter,将tg2环境下的python.exe作为编译器。如我的编译器在:e:\\tg2env\Scripts\python.exe.这样可以使用到TG2相关的egg。

        3).新建之后,返回PyDev Interpreter,选择刚才建好的编译器。

5.配置

     1)选中Run->Run configurations 或者 Debug Configurations(根据个人需要选择)。

     2)在name中取个名字。

     3)Main选项卡:Project ->选中自己的项目, Main Module ->选中自己项目中的launch_tg.py。

     4)Arguments选项卡: Working directory 选中 other -> ${workspace_loc:XXX},XXX是自己项目的名称。

     5)Common选项卡:Display in favourites menu,选中Run或者Debug可以在run或者debug的下拉菜单直接运行。

你可能感兴趣的:(eclipse,windows,python,OS,ide)