Command shell access within Python

Stefan Antoni sasoft at gmx.de
Sun Nov 4 20:20:10 EST 2001


On Sun, Nov 04, 2001 at 01:02:46PM -0500, pieroul at attglobal.net wrote:

> I also need to get the return code (c exit()) of the program that ran.
os.system() gives you the return code of your command.
try interactively:

import os

print os.system('ls')

... listing ...
0 <-- return code

-- 
Stefan Antoni




More information about the Python-list mailing list