Cross platform spawning

Harvey Thomas hst at empolis.co.uk
Tue Jun 11 12:05:03 EDT 2002


Peter Scott wrote:
> 
> I am trying to make a script spawn a seperate process, like you would
> do like this on unix:
> 
> os.system('python myscript.py myargument &')
> 
> But the & at the end (to make a separate process) doesn't work on
> Windows. I want the script to run on both Linux (*BSD, whatever) and
> Windows. I didn't want to have to find out the path to the python
> interpreter, so os.spawnlp (with no blocking) sounded perfect until I
> saw that it wasn't available on Windows.
> 
> Does anyone out there know what I can do in this situation?

Not sure if it's exactly what you want but under Win NT you could use

os.system('start python myscript.py myargument')

(see the NT help for details of the start command)

_____________________________________________________________________
This message has been checked for all known viruses by the MessageLabs Virus Scanning Service.





More information about the Python-list mailing list