subprocess(python)
Posted on Sun 18 April 2010 in misc • Leave a comment
subprocess 是python在2.4版本之后引入的用于subprocess管理的module。subprocess中有一个重要的类Popen和一个重要的方法call。下面对Popen和call进行相关说明。
Popen用于新建一个subprocess,下面是它的构造函数。
class subprocess.Popen
(args, bufsize=0,
executable=None, stdin=None, stdout=None, stderr=None,
preexec_fn=None, close_fds=False, shell=False, cwd=None,
env=None, universal_newlines=False, startupinfo=None,
creationflags=0)
其中:
args是运行进程的命令行(与shell中输入的命令行一样);
bufsize, if given, has the same meaning as the corresponding ...
Continue reading