"Peter" <[EMAIL PROTECTED]> wrote > Is there a way to detect errors when running shell commands using > os.popen?
You have to parse the programs output. Usually errors will appear on stderr so you need to read that as well as stdout. This may be slightly easier using the new subprocess module and the Popen class. > 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. Even if the program returns an error popen is still working just fine so no exception gets raised. You must parse the output (or check the status value, but thats not reliable in all programs) HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor