python - Running a Twisted Application in PyDev -


i debug twisted application (10.0.0) using eclipse (3.5.2) pydev module (1.6.4) , python (2.6.5). run application command line specify following:

c:\python26\python c:\python26\scripts\twistd.py -ny mytwistedapp.py

to accomplish using pydev created new pydev project , imported mytwistedapp.py , twistd.py. under project's run configuration specified c:\python26\scripts\twistd.py main module. if select run -> debug configurations runs twistd.py no parameters (half-way there, right?). if try add program arguments run configuration (-ny mytwistedapp.py) processed pydev debugger instead of twistd.py. 2 questions:

  1. is specifying twistd.py main module right approach?
  2. if so, how can pass twistd.py parameters needs run mytwistedapp.py (-ny mytwistedapp.py)?

first off, thank kind , gracious support in matter!

the key running twisted application via pydev module of eclipse define twistd.py main module in run configuration. following steps can used:

these instructions assume can run twisted applications on system, means you've installed zope , twisted. example, following works you:

python twistd.py mytwistapp.tac

these instructions assume have installed , configured pydev in eclipse, including definition of pythonpath. 1. navigate window -> preferences -> pydev -> interpreter (python) 2. under libraries tab (system pythonpath), system libs should contain location of python instllation (e.g., c:\python26, c:\python26\dlls\, c:\python26\lib, etc). 3. add zope egg , twisted folder system libs. example, c:\python26\lib\site-packages\twisted , c:\python26\lib\site-packages\zope.interfaces-3.6.1-py2.6-win32.egg

create new pydev project

  1. create new pydev project (e.g., myproj)
  2. import various twisted application files
  3. * add twistd.py project *. rather adding copy of file project linked existing file (file -> new -> file -> advanced -> "link file in file system" -> c:\python26\scripts\twistd.py). key use twistd.py run application within eclipse.

now project setup, create new run configuration.

  1. run -> run configurations
  2. use following values under main tab
    • name: twisted (or whatever)
    • project: myproj
    • main module: ${workspace_loc:myproj/twistd.py}
  3. use following values under arguments tab
    • program arguments: -ny ${workspace_loc:myproj/mytwistapp.tac}

and that's it! key importing twistd.py main module, allows program arguments passed twsttd.py, command line.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -