spawnv

Karl Putland kperacles at geocities.com
Sun Aug 1 16:15:11 EDT 1999


This worked for me on a project I did a couple of months ago.  It did its thing for a couple of minutes then when it exited the Python script resumed.

...
import os
...
    os.spawnv(os.P_WAIT, os.path.join(gmpath,'gmw4.exe'),
              [r' /u:MASTER', r' /p:ACCESS', r' /r:69,5'])
...

spawnv (mode, path, args) 
Execute the program path in a new process, passing the arguments specified in args as command-line parameters. args may be a list or a tuple. mode is a magic operational constant. See the Visual C++ Runtime Library documentation for further information. Availability: Windows. New in version 1.5.2. 

P_WAIT 
P_NOWAIT
P_NOWAITO
P_OVERLAY
P_DETACH
Possible values for the mode parameter to spawnv() and spawnve(). Availability: Windows. New in version 1.5.2. 


Karl Putland
kperacles at geocities.com



Craig Curtis <c.curtis at worldnet.att.net> wrote in message news:19990801171952.JFVG5731 at default...
> I am trying to spawn c:\windows\notepad.exe from a Python program.  I want
> the python script to wait for Notepad to exit.  
> How can I do this?  
> 
> I have tried all combinations I can think of using execv, spawn, system and
> cannot get it to work.
> 
> Could someone please post the exact command sequence to type in.
> 
> Thanks in advance,
> Craig Curtis
> 
> 





More information about the Python-list mailing list