Re: [Tutor] Replacing cmd.exe with custom .py application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ezra Taylor

    Re: [Tutor] Replacing cmd.exe with custom .py application

    Is there something similar to /dev/null on Windows?

    On Tue, Sep 30, 2008 at 2:13 PM, Ezra Taylor <ezra.taylor@gm ail.comwrote:
    Joseph:
    Check out subprocess. The subprocess module is on python
    2.4. Also, use subprocess.call ("your command",shell= True)
    >
    On Linux/Unix, the process is below
    >
    import subprocess
    >
    ret = subprocess.call ("dir",shell=Tr ue,stdout=open( '/dev/null','w'),stde rr=subprocess.S TDOUT)
    >
    print ret
    >
    You should get a return value of 0. Which means that it was
    successful. I'm still learning this myself, so some of these other
    guys might have more input.
    >
    >
    >
    >
    >
    On Tue, Sep 30, 2008 at 10:32 AM, A. Joseph <joefazee@gmail .comwrote:
    >>
    >>
    > Instead of going to the command line all the time, I want to create a small
    >customized cmd.exe of my own, how can I get the return value from
    >os.system() because I was thinking I can do soothing with os.system(), In
    >case my question is not clear, just like an IDE that plugged in another
    >.exe application.
    >>
    >>
    >>
    >Sorry for any mistake in my question. Just help me if you can
    >>
    >______________ _______________ _______________ ___
    >Tutor maillist - Tutor@python.or g
    >http://mail.python.org/mailman/listinfo/tutor
    >>
    >>
    >
    >
    >
    --
    Ezra Taylor
    >


    --
    Ezra Taylor
Working...