Re: Regarding subprocess module

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel Genellina

    Re: Regarding subprocess module

    En Fri, 05 Sep 2008 09:56:02 -0300, tarun <tarundevnani@g mail.com>
    escribió:
    import subprocess,time
    cmdExe = "C:\\WINDOWS\\s ystem32\\cmd.ex e"
    myProcess = subprocess.Pope n(cmdExe,stdin= subprocess.PIPE )
    time.sleep(2)
    myProcess.stdin .write('cd Desktop\r\n')
    >
    I copied the above lines of code to a file and tried executing the python
    file from dos box (command prompt) on windows
    I want subprocess.Pope n to open a new dos box. But it works in the same
    window. What should I do to open the subprocess in new window?
    Add this argument: creationflags = subprocess.CREA TE_NEW_CONSOLE

    See "Creation of a Console" in MSDN:
    <http://msdn.microsoft. com/en-us/library/ms682528(VS.85) .aspx>
    --
    Gabriel Genellina

Working...