How do I check return value of popen2.* ?

gradha at iname.com gradha at iname.com
Sat Mar 10 12:57:57 EST 2001


Hello.

I have tried the following test. File t2.py:

	#!/usr/bin/env python
	
	import sys, popen2
	
	sal, en, err = popen2.popen3 ("./test.py")
	val1 = en.close()
	print sal.readlines()
	val2 = sal.close()
	print err.readlines()
	val3 = err.close()
	
	print val1, val2, val3
	
File test.py:

	#!/usr/bin/env python
	
	import sys
	
	sys.exit(2)
	
Now, when I run t2, the output is:

	[]
	[]
	None None None

How am I supposed to check the return value of the opened pipe?

-- 

 Grzegorz Adam Hankiewicz   gradha at iname.com - http://gradha.infierno.org
 Other web pages:  http://glub.ehu.es/  -  http://welcome.to/gogosoftware/



More information about the Python-list mailing list