[Twisted-Python] Processes in Twisted, only possible to run external prog?

glyph at divmod.com glyph at divmod.com
Fri Aug 29 09:35:24 EDT 2008

On 09:06 am, gabriel.rossetti at arimaz.com wrote:
>so I need to use processes instead, as they each have their own current 
>dir. The thing is that from what I understand, Twisted's process API is 
>intended to be used with external executables only, correct? I wasn' t 
>able to fins anything that allowed me to do stuff like I would using 
>fork(). Should I just use python's fock() instead? Is it safe with 

As it happens, "python" is an "external executable".  Here's an example 
of spawning it in such a way as to make sure that sys.path is set 

However, Wine is also an external process.  Perhaps you just want to 
spawn the Wine command-line using spawnProcess using the 'path' 
parameter set to a directory that you have created in the main process, 
then clean it up when the process exits?


Using fork() in Python has a lot of confusing issues associated with it 
unless you're going to exec() immediately afterwards.  You probably want 
to stick to one of these other approaches.

More information about the Twisted-Python mailing list