Re: running a shell command from a python program

2005-02-23 Thread aurora
In Python 2.4, use the new subprocess module for this. It subsume the popen* methods. Hi, I'm a newbie, so please be gentle :-) How would I run a shell command in Python? Here is what I want to do: I want to run a shell command that outputs some stuff, save it into a list and do stuff with th

Re: running a shell command from a python program

2005-02-23 Thread Leif B. Kristensen
Sandman wrote: > How would I run a shell command in Python? > > Here is what I want to do: > I want to run a shell command that outputs some stuff, save it into a > list and do stuff with the contents of that list. There's a Python Cookbook example that should fit nicely with what you're trying

Re: running a shell command from a python program

2005-02-23 Thread Sandman
Doh, use the search Luke: http://www.wellho.net/forum/Programming-in-Python-and-Ruby/Running-shell-commands-from-Python.html Seems like popen is the way to go. S -- http://mail.python.org/mailman/listinfo/python-list

Re: running a shell command from a python program

2005-02-23 Thread Thomas Guettler
Am Wed, 23 Feb 2005 07:00:31 -0800 schrieb Sandman: > Hi, >I'm a newbie, so please be gentle :-) > > How would I run a shell command in Python? [cut] > Is popen the answer? Also, where online would I get access to good > sample code that I could peruse? Yes, popen is the answer. I recommend

running a shell command from a python program

2005-02-23 Thread Sandman
Hi, I'm a newbie, so please be gentle :-) How would I run a shell command in Python? Here is what I want to do: I want to run a shell command that outputs some stuff, save it into a list and do stuff with the contents of that list. I started with a BASH script actually, until I realized I rea