本文整理汇总了Python中subprocess.Popen.processing方法的典型用法代码示例。如果您正苦于以下问题:Python Popen.processing方法的具体用法?Python Popen.processing怎么用?Python Popen.processing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subprocess.Popen
的用法示例。
在下文中一共展示了Popen.processing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: executeAsync
# 需要导入模块: from subprocess import Popen [as 别名]
# 或者: from subprocess.Popen import processing [as 别名]
def executeAsync(self, command, *args):
# process.stdin, .stdout, stderr #Note: remember to flush()
# .stdin.write(data) .stdin.flush()
# .stdout.read([amount]), .stdout.readline()
# .poll() -> None (still processing) or returncode (int)
# .kill()
# .communicate(input) -> (stdoutData, stderrData) Note: waits until the process has finished
# Also closes input and output streams
# .returncode
# -ADDED-
# .close() To close all input and output streams
# .processing() -> True while still processing
args.insert(0, command)
process = Popen(args=args, executable=command, stdin=PIPE, stdout=PIPE, stderr=PIPE)
def close():
process.stdoutData, process.stderrData = process.communicate()
process.close = close
def processing():
return process.poll()==None
process.processing = processing
def write(data):
process.stdin.write(data)
return process