开发者

How to get a readable "script" output?

开发者 https://www.devze.com 2023-03-09 06:49 出处:网络
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 re

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

精彩评论

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