import os然后查找popen
popen(...)
popen(command [, mode='r' [, bufsize]]) -> pipe
Open a pipe to/from a command returning a file object.
popen2(cmd, mode='t', bufsize=-1)
Execute the shell command 'cmd' in a sub-process.
On UNIX, 'cmd'
may be a sequence, in which case arguments will be passed directly to
the program without shell intervention (as with os.spawnv()).
If 'cmd'
is a string it will be passed to the shell (as with os.system()). If
'bufsize' is specified, it sets the buffer size for the I/O pipes.
The
file objects (child_stdin, child_stdout) are returned.
popen3(cmd, mode='t', bufsize=-1)
Execute the shell command 'cmd' in a sub-process.
On UNIX, 'cmd'
may be a sequence, in which case arguments will be passed directly to
the program without shell intervention (as with os.spawnv()).
If 'cmd'
is a string it will be passed to the shell (as with os.system()). If
'bufsize' is specified, it sets the buffer size for the I/O pipes.
The
file objects (child_stdin, child_stdout, child_stderr) are returned.
popen4(cmd, mode='t', bufsize=-1)
Execute the shell command 'cmd' in a sub-process.
On UNIX, 'cmd'
may be a sequence, in which case arguments will be passed directly to
the program without shell intervention (as with os.spawnv()).
If 'cmd'
is a string it will be passed to the shell (as with os.system()). If
'bufsize' is specified, it sets the buffer size for the I/O pipes.
The
file objects (child_stdin, child_stdout_stderr) are returned.