Problems with os.system

marduk marduk+news at letterboxes.org
Fri Sep 2 16:59:45 EDT 2005


On Fri, 2005-09-02 at 13:45 -0700, alexLIGO wrote:
> Hi,
> 
> I am trying to run a python script that executes several other programs
> on the bash (under linux) and reads some of the output of those
> programs. This works fine for a couple of os.system() calls, but then
> it does not work anymore. os.system() returns always -1, but when
> executing exactly the same program directly on the linux-bash it works!
> 
> Could this be a memory problem? It happens when there is much data
> stored in a python list. How can I check the memory usage in my python
> script? Can I force python to execute the program on the bash? What can
> I do?

Are you trying to read the output (stdout) of the program?  If so you
should be using os.popen() not os.system().  




More information about the Python-list mailing list