[Twisted-Python] Re: Debugging client programs

Itamar Shtull-Trauring itamar at itamarst.org
Wed Jul 30 16:58:06 EDT 2003


On Wed, 30 Jul 2003 15:45:02 -0500
John Goerzen <jgoerzen at complete.org> wrote:

> Nothing shows how this is to be done with a client.

Same way exactly.

> What's worse, the application HOWTO also doesn't show how to choose
> which reactor one is using, which is going to be a critical issue for
> me.  I have all these things solved outside the twistd/Application
> framework, but am not sure how to do it inside that framework.

twistd --help should tell you (but, say "twistd --reactor=gtk -y
yourfile.py").

> Also, I have no objection to running twistd for my debugging, but my
> excuse to not running twistd for end-users is that they should not
> have to run "twistd /usr/bin/offlineimap" -- they should just run
> offlineimap and invoke Python directly.

You can have it work both ways, using an if __name__ == '__main__'.
Again, I suggest you read my tutorial, the link to which was on the
previous email (it's on my homepage.) If you want your program to parse
command line arguments this won't work though.

So, you can just use PDB directly, as with *any* python script.
"/usr/lib/python2.2/pdb.py offlineimap.py".

-- 
Itamar Shtull-Trauring    http://itamarst.org/
http://www.zoteca.com -- Python & Twisted consulting




More information about the Twisted-Python mailing list