首先,感谢大家对此事的友好和热情支持!
通过Eclipse的PyDev模块进行扭曲性应用的关键是界定扭曲性。 如同Run Configuration中的主要模块。 可采取以下步骤:
这些指示假定,你本可以在你的系统中进行扭曲性的申请,这意味着你安装了ope和tw。 例如,以下工作已经为你服务:
python twistd.py mytwistapp.tac
These instructions also assume that you have already installed and configured PyDev in Eclipse, including the definition of the PYTHONPATH.
1. Navigate to Window -> Preferences -> PyDev -> Interpreter (Python)
2. Under Libraries Tab (System PYTHONPATH), System Libs should already contain location of your Python instllation (e.g., c:python26, c:python26dlls, c:python26lib, etc).
3. Add the Zope egg and the Twisted folder to System libs. For example, c:python26libsite-packages wisted and c:python26libsite-packageszope.interfaces-3.6.1-py2.6-win32.egg
创建新的Pydev项目
- Create a new PyDev project (e.g., MYPROJ)
- Import your various twisted application files
- * Add twistd.py to your project *. Rather than adding a copy of the file to my project I linked to the existing file (File -> New -> File -> Advanced -> "Link to file in the file system" -> c:python26scripts wistd.py). This is key as you will use twistd.py to run your application from within Eclipse.
既然你的项目已经启动,就产生了一个新的运行配置。
- Run -> Run Configurations
- Use the following values under the Main Tab
- Name: Twisted (or whatever)
- Project: MYPROJ
- Main Module: ${workspace_loc:MYPROJ/twistd.py}
- Use the following values under the Arguments Tab
- Program Arguments: -ny ${workspace_loc:MYPROJ/mytwistapp.tac}
而这样说! 关键是先进口。 如同主模块一样,后者允许将方案论点传入扭曲。 p,就像你从指挥线做的那样。