How to launch idlex from virtualenv through python script -
i trying automate couple of steps have repeatedly on windows, open command prompt , starting virtualenv , launching idlex. writing python script can double click automatically perform both these steps. read this answer couldn't understand it. below script have written making 2 calls popen
import subprocess #launches virtualenv in command prompt proc1 = subprocess.popen('start\ "idle"\ /d c:\\python27\\fp\ /wait\ c:\\python27\\fp\\scripts\\activate.bat', shell=true, stdin=subprocess.pipe, stdout=subprocess.pipe, stderr=subprocess.pipe) #starts idlex proc2 = subprocess.popen('start\ "idle"\ /b\ /d c:\\python27\\fp\ /wait\ c:\\python27\\fp\\scripts\\python.exe\ c:\\python27\\fp\\scripts\\idlex.py', shell=true, stdin=subprocess.pipe, stdout=subprocess.pipe, stderr=subprocess.pipe)
i want perform both these steps without making second popen call, communicate() isn't working , don't understand why. because start
spawns process handle isn't available?
Comments
Post a Comment