[Twisted-Python] Twistd and command line options...

Jean-Paul Calderone exarkun at divmod.com
Thu Jun 15 15:14:56 EDT 2006


On Thu, 15 Jun 2006 13:34:59 -0400, "Chaz." <eprparadocs at gmail.com> wrote:
>I have built a twistd application and now I want to pass in some
>arguments from the command line. The code I use is:
>
>class Options(usage.Options) :
>   optParameters = [['wkp','Z','2200','The well known port']]
>
>config = Options()
>try :
>    config.parseOptions()
>except usage.UsageError, e:
>    print '%s: %s' % (sys.argv[0],e)
>    print '%s: Try --help for usage details.' % (sys.argv[0])
>    sys.exit(1)
>
>I've tried running "twistd -ny --wkp=2200 foo.tac" and "twistd -ny
>foo.tac --wkp=2000" without success.
>
>I've decided I must not know how to get command line options to foo.tac.
>Can someone please enlighten me?

Check out the following threads:

http://twistedmatrix.com/pipermail/twisted-python/2006-June/013330.html
http://twistedmatrix.com/pipermail/twisted-python/2005-May/010529.html
http://twistedmatrix.com/pipermail/twisted-python/2005-June/010856.html

Jean-Paul




More information about the Twisted-Python mailing list