[python-win32] os.execv

Chris Ingram Chris.Ingram@Synchrologic.com
Wed, 10 Oct 2001 14:56:44 -0400


As fork doesn't exist on win32, you'd probably want to do spawn
(specifically os.spawnv).  os.system() will simply call out to the external
program and upon completion, the Python script continues.  os.spawnv(), on
the other hand, actually creates another concurrently running process
(similar to doing a fork then an exec on Unix) such that your Python script
continues to run while the program it spawned is also running.

--
Chris Ingram, Synchrologic, Inc.
Email: Chris.Ingram@synchrologic.com

-----Original Message-----
From: Jorgensen, Jens [mailto:jens.jorgensen@tallan.com]
Sent: Wednesday, October 10, 2001 2:46 PM
To: Richard Cooper
Cc: python-win32@python.org
Subject: Re: [python-win32] os.execv


You didn't expect it to kill the pythonwin process? That's what exec is
supposed to do: overlay the process with a new process and start
executing that one, replacing the running process. Maybe you'd really
like it to fork? Or maybe you just want the system() call instead so the
calling process isn't wiped out.

Richard Cooper wrote:

>Hi,
>
>Is the a known issue with the os.execxxx function on win32? Because, I
can't
>get them to work.
>
>This is my test.
>
>1) Create a batch file called test.bat containing the single line:
>echo hello
>
>2) Running this from the command line works fine
>
>3) Open python win and type
>
>>>>import os
>>>>os.execv(r"d:\test.bat",["foo"])
>>>>
>
>This kills the pythonwin process
>
>Rich
>
>_______________________________________________
>Python-win32 mailing list
>Python-win32@python.org
>http://mail.python.org/mailman/listinfo/python-win32
>


-- 
Jens B. Jorgensen
jens.jorgensen@tallan.com



_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32