python Programming Glossary: proc1
Python on Windows - how to wait for multiple child processes? http://stackoverflow.com/questions/100624/python-on-windows-how-to-wait-for-multiple-child-processes wait polling Something like this almost works for me proc1 subprocess.Popen 'python' 'mytest.py' proc2 subprocess.Popen.. 'mytest.py' proc2 subprocess.Popen 'python' 'mytest.py' proc1.wait print 1 finished proc2.wait print 2 finished The problem.. 2 finished The problem is that when proc2 finishes before proc1 the parent process will still wait for proc1 . On Unix one would..
How to get environment from a subprocess in Python http://stackoverflow.com/questions/1214496/how-to-get-environment-from-a-subprocess-in-python the program look like import subprocess subprocess.call 'proc1' # this set env. variables for proc2 subprocess.call 'proc2'.. 'proc2' # this must have env. variables set by proc1 to work but the to process don't share the same environment... eg. run_program.bat and run both programs @echo off call proc1.bat proc2 The script will run and set its environment variables...
Killing a process created with Python's subprocess.Popen() http://stackoverflow.com/questions/4084322/killing-a-process-created-with-pythons-subprocess-popen Popen.kill import subprocess import os signal import time proc1 subprocess.Popen kvm hda path xp.img shell True time.sleep 2.0.. kvm hda path xp.img shell True time.sleep 2.0 print 'proc1 ' proc1.pid subprocess.Popen.kill proc1 However proc1 still.. hda path xp.img shell True time.sleep 2.0 print 'proc1 ' proc1.pid subprocess.Popen.kill proc1 However proc1 still exists after..
|