Twisted on Windows

Bryan Richardson btricha at gmail.com
Thu Nov 18 09:58:21 EST 2010


Hello All,

First off I must say that Twisted is a very nice event driven I/O
package indeed. Thanks to all the developers who have contributed to
it, as it's made my life much easier.

Now for my question...

I have a custom server application, and I have it structured as such:

MyServerApp/ <-- root directory
   server.py
   foo/
      __init__.py
      factory.py

In my server.py file, which is a Twistd config file that can be
executed with twistd -ny server.py, I have the following import line:

from foo.factory import MyServerFactory

When I run 'twistd -ny server.py' on my Linux machine from within the
root MyServerApp directory, all works as expected. However, when I try
to do the same thing on a Windows machine using the twistd script that
gets installed, I get an error saying that foo.factory cannot be
found. However, if I modify my server.py file on Windows to just
create the factory and start the reactor, I can run it just fine with
'python server.py' even though it still has the import line for
MyServerFactory.

Bottom line is, on Windows, the python executable can find my custom
module in a sub directory but the twistd script cannot. Any ideas why
this is?

--
Thanks!
Bryan



More information about the Python-list mailing list