[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Equivalent of system()?

Max

2/23/2008 4:44:00 AM

Is there a Python equivalent of C++'s system()?

TIA
5 Answers

Grant Edwards

2/23/2008 4:59:00 AM

0

On 2008-02-23, Max <maxh.is.here@gmail.com> wrote:

> Is there a Python equivalent of C++'s system()?

The closest thing is probably system().

It's in the os module.

--
Grant

Jeff Schwab

2/23/2008 5:00:00 AM

0

Max wrote:
> Is there a Python equivalent of C++'s system()?

More or less. You probably want subprocess.Popen:

>>> import subprocess
>>> subprocess.Popen("echo hello", shell=True)
hello
<subprocess.Popen object at 0x2ab8f3665d10>

http://docs.python.org/lib/node533.html#C...

Max

2/23/2008 5:02:00 AM

0

Thanks for the help!

Dennis Lee Bieber

2/23/2008 5:20:00 AM

0

On Fri, 22 Feb 2008 20:44:05 -0800 (PST), Max <maxh.is.here@gmail.com>
declaimed the following in comp.lang.python:

> Is there a Python equivalent of C++'s system()?
>

Uhmm

import os
os.system(...)
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfraed@ix.netcom.com wulfraed@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-asst@bestiaria.com)
HTTP://www.bestiaria.com/

subeen

2/23/2008 8:08:00 AM

0

This link may help: http://love-python.blogspot.com/2008/02/execute-linux-commands-in-p...

On Feb 23, 10:44 am, Max <maxh.is.h...@gmail.com> wrote:
> Is there a Python equivalent of C++'s system()?
>
> TIA