【发布时间】:2014-09-02 12:39:10
【问题描述】:
谁能告诉我如何获得与变量相同的程序控制台输出?
例如:
print "this is simple output"
print "and this is another simple output"
ConsOutputs = some_function_to_get_those_strings_from_console()
【问题讨论】:
-
您为什么要这样做?有几条路线(例如,使用日志记录代替,滚动您自己的
print函数,更改stdout),但哪种路线最好取决于您的目标。