how to change os.popen4 to subprocess

skyworld chenyong20000 at gmail.com
Fri Oct 26 22:28:39 EDT 2012


Hi,

I'm new to python and I'm trying to porting some scripts from v0.96 to
v2.0.1. A piece of code is like this:

cmd_h = os.popen4(env['SYSCMDLINE'])[1]

the system indicates the popen4 is deprecated and suggest to use
subprocess. Can anybody tell me how to use subprocess in this case?
and what does "[1]" here means?

thanks.



More information about the Python-list mailing list