mal wrote: > BTW, (pardon my ignorance) what is the most portable way to > do the equivalent of a os.system("cmd &") as native OS > API call ? [On Unix, "cmd &" starts a new process which runs > in the background and detached from the calling process.] >=20 > I've looked at .execve and .spawnve, but they both replace > the current process. on windows, spawn(P_NOWAIT) does what you want. here's an example from the eff-bot guide: # # os-spawn-example-2.py import os import string def run(program, *args, **kw): # find executable mode =3D kw.get("mode", os.P_WAIT) for path in string.split(os.environ["PATH"], os.pathsep): file =3D os.path.join(path, program) + ".exe" try: return os.spawnv(mode, file, (file,) + args) except os.error: pass raise os.error, "cannot find executable" run("python", "hello.py", mode=3Dos.P_NOWAIT) </F>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4