Cross platform spawning

Peter Scott sketerpot at chase3000.com
Tue Jun 11 22:34:14 EDT 2002


"Harvey Thomas" <hst at empolis.co.uk> wrote:
> 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)

Yes, that's exactly what I want. I ended up using code like this:

if sys.platform.startswith('win'):
    os.system('start python myscript.py myargument')  # Windows
else:
    os.system('python myscript.py myargument &')  # Unix

It works perfectly, and that solved the final bug in my program. Thanks! :-)



More information about the Python-list mailing list