How to execute a linux command by python?

2006-10-18 Thread haishan chang
How to execute a linux command by python?
for example: execute ls or useradd oracle
Who can help me? thank you!
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: How to execute a linux command by python?

2006-10-18 Thread Fredrik Lundh
haishan chang wrote:

 How to execute a linux command by python?
 for example: execute ls  or useradd oracle
 Who can help me?

start here:

 http://www.python.org/doc/lib/

/F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to execute a linux command by python?

2006-10-18 Thread Fredrik Lundh
Fredrik Lundh wrote:

 start here:
 
  http://www.python.org/doc/lib/

make sure you skim though the *entire* list.  when you've done that, see 
the process management section in the os module documentation (make 
sure to read the entire page before you decide which API to use), and 
also the subprocess module documentation.

/F

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to execute a linux command by python?

2006-10-18 Thread Daniel Nogradi
  How to execute a linux command by python?
  for example: execute ls  or useradd oracle
  Who can help me?

 start here:

  http://www.python.org/doc/lib/


And continue here:

http://www.python.org/doc/lib/os-process.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to execute a linux command by python?

2006-10-18 Thread Steven Bethard
Daniel Nogradi wrote:
  How to execute a linux command by python?
  for example: execute ls  or useradd oracle
  Who can help me?

 start here:

  http://www.python.org/doc/lib/
 
 And continue here:
 
 http://www.python.org/doc/lib/os-process.html

You probably should use the subprocess module instead:

http://www.python.org/doc/lib/module-subprocess.html

I've had much better cross-platform results with that.

STeVe
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to execute a linux command by python?

2006-10-18 Thread venkatbo

Fredrik Lundh wrote:
 haishan chang wrote:

  How to execute a linux command by python?
  for example: execute ls  or useradd oracle
  Who can help me?

 start here:

  http://www.python.org/doc/lib/

 /F

After reading the matl. pointed to by the many links listed here,
you can try pexpect. Provided for more control and interactivity.
More at: http://pexpect.sourceforge.net/

/venkat

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to execute a linux command by python?

2006-10-18 Thread Mark Elston
* [EMAIL PROTECTED] wrote (on 10/18/2006 11:32 AM):
 Fredrik Lundh wrote:
 haishan chang wrote:

 How to execute a linux command by python?
 for example: execute ls  or useradd oracle
 Who can help me?
 start here:

  http://www.python.org/doc/lib/

 /F
 
 After reading the matl. pointed to by the many links listed here,
 you can try pexpect. Provided for more control and interactivity.
 More at: http://pexpect.sourceforge.net/
 
 /venkat
 

BTW, is there a version of pexpect that works with Windows?  This
package requires pty and termios which isn't supported on Windows.

Mark
-- 
http://mail.python.org/mailman/listinfo/python-list