Starting application inside an application

Chris Watson chris at voodooland.net
Thu Jan 11 12:00:36 EST 2001


Horst,

> What I want to do is simply starting a second instance of my application
> (just like starting the application from the command line a second
> time). I am looking for a function like spawnv() which unfortunately
> only works for the windows platform.

	Use os.spawnv works great on FreeBSD and Python 2.0 built fresh 
from the ports tree. It isn't in 1.x but it is in 2.0. I am assuming your
using 1.x since you say it's only a windows "feature". Just upgrade to
2.0. The call works like a charm :-)

#!/usr/local/bin/python

import os
host = raw_input("Enter a hostname: ");
os.spawnv(os.P_WAIT, '/usr/bin/scp', ('-v', 'x86bsd@%s:/home/x86bsd/TESTFILE' % host, '/tmp/TESTFILE'))

--
=============================================================================
-Chris Watson         (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek 
Work:              scanner at jurai.net | Open Systems Inc., Wellington, Kansas
Home:  scanner at deceptively.shady.org | http://open-systems.net
=============================================================================
WINDOWS: "Where do you want to go today?"
LINUX: "Where do you want to go tomorrow?"
BSD: "Are you guys coming or what?"
=============================================================================
irc.openprojects.net #FreeBSD -Join the revolution!
ICQ: 20016186





More information about the Python-list mailing list