[Twisted-Python] Processes in Twisted, only possible to run external prog?
gabriel.rossetti at arimaz.com
Mon Sep 1 03:47:20 EDT 2008
glyph at divmod.com wrote:
> 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 Twisted?
> 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 properly:
> 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?
mmmm, yes, that sounds nice, I'll try that, thanks!
> 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.
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python