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

Chaz. eprparadocs at gmail.com
Thu Jun 15 11:34:59 MDT 2006


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?

Thanks,
Chaz




More information about the Twisted-Python mailing list