[Tutor] Detect errors when using os.popen.readlines()

Peter lists1 at marscode.net
Sat Mar 31 18:29:44 CEST 2007


Is there a way to detect errors when running shell commands using 
os.popen?  I'm trying to get an ip address for ethernet interfaces, and 
if an interface doesn't exist I get an error from the shell command.  I 
tried using try and except, but that did seem to work.

Thanks in advance.

Peter


More information about the Tutor mailing list