开发者

How to get a readable "script" output?

When I run a python script I wa开发者_JAVA技巧nt to capture everything which is output on the screen. When I use the "script" command and capture the log in "typescript" file, the output in not readable when using vi. Its readable using


Try:

python -u yourscript.py 1> log 2> err

Or for appending

python -u yourscript.py 1>> log 2>> err


./pyscript.py &> output.txt

or:

python script.py &> output.txt

Note: redirects both stdout and stderr to output.txt.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜