2011-05-15 56 views
-1

以下是使用子进程模块的python代码。有人可以解释代码在做什么吗?python子进程调用

process = subprocess.Popen(['aspell', 'list'], 
    stdin = subprocess.PIPE, # reading from the op of a pipe. 
    stdout = subprocess.PIPE) # writing to the i/p of a pipe 

(result, stderrdata) = process.communicate(" ".join(text)) 
+0

谁的评论是在中间两行? – BoltClock 2011-05-15 19:21:58

回答

0

它是一个非常糟糕的脚本,打开过程aspell给它的参数列表。然后将stdout和stderr管道输入到一个元组中,同时将''.join(文本)作为标准输入提供给进程。

+0

但你能解释一下popen的过程吗? – techi 2011-05-15 20:27:03