This code run 'X -configure' using $PATH for looking for its path :: try: #retcode = call("X" + " -configure", shell=True) # 2.4
code_return = os.spawnlp(os.P_WAIT, "X", "X", "-configure") if retcode < 0: print >>sys.stderr, "Child was terminated by signal", -retcode else: print >>sys.stderr, "Child returned", retcode except OSError, e: print >>sys.stderr, "Execution failed:", e :: 1) The OSError exception never is runned. I tested with an command that doesnt exist (Xe) 2) For redirecting command output message, I think that I could to use: os.spawnlp(os.P_WAIT, "X", "X", "-configure", "&>/dev/null") But, is there any way more elegant in python? 3) That command built a file. Is it possible knows its name? Thanks in advance! _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor