How to use shell return value like $? In python?

aaabbb16 at hotmail.com aaabbb16 at hotmail.com
Sun Oct 23 22:44:42 EDT 2011


exp:
os.system('ls -al')
#I like to catch return value after this command. 0 or 1,2,3....
does python support to get "$?"?
then I can use something like:
 If $?==0:
     ........
................
TIA
david





More information about the Python-list mailing list