【发布时间】:2014-03-10 10:51:29
【问题描述】:
我在 python 脚本中调用一个可执行文件,它在终端中给出如下输出:
迭代次数:150
每步的平均时间为 0.306834 毫秒
平均碰撞时间为 0.027553 毫秒
速度更新的平均时间为 0.109900 毫秒
位置更新的平均时间为 0.031053 毫秒
总循环时间为 46.2161 毫秒
但我想将此文本存储在一个变量中,以便我可以对其进行编辑。这个怎么办???
【问题讨论】:
-
output = Popen(["mycmd", "myarg"], stdout=PIPE).communicate()[0]