1
这里的Python代码运行任意命令返回它的标准输出的数据,或者提高对非零退出代码的异常:查找执行时间subprocess.Popen蟒蛇
proc = subprocess.Popen(
cmd,
stderr=subprocess.STDOUT, # Merge stdout and stderr
stdout=subprocess.PIPE,
shell=True)
的子模块不支持执行如果它超过特定的阈值=>超时(能够杀死运行时间超过X秒的进程)
什么是最简单的方式来实现在Linux2.6上运行的get_execution_time和timeout ?