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



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=True,stdout=open('/dev/null','w'),stderr=subprocess.STDOUT)

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@xxxxxxxxx> wrote:


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@xxxxxxxxxx
http://mail.python.org/mailman/listinfo/tutor





--
Ezra Taylor
.



Relevant Pages

  • Re: sending input to an embedded application
    ... within a Python-run GUI, using the GUI just to capture and send input ... from existing python docs: ... Replacing older functions with the subprocess module..." ... hda: ST9160821A, ATA DISK drive ...
    (comp.lang.python)
  • Re: subprocess.Popen howto?
    ... Carl Banks wrote: ... I took a test run on "subprocess" a few months ago. ... What if you want os.system without the shell? ... Build the TSR and Start from Python or the bootup autostart ...
    (comp.lang.python)
  • Re: Python vs. Perl
    ... >> better with Python 2.4's subprocess module. ... > that you specify, can run the subprocess as a different user, and more... ... programmer-friendly ExitStatus object that processess can return. ...
    (comp.lang.python)
  • Re: Python vs. Perl
    ... >> better with Python 2.4's subprocess module. ... > that you specify, can run the subprocess as a different user, and more... ... programmer-friendly ExitStatus object that processess can return. ...
    (comp.lang.python)
  • win32pipe.popen4 howto example
    ... trying to remind myself that running a subprocess under Win32 isn't a ... from python docs, ... Executes cmd as a sub-process. ...
    (comp.lang.python)