Reputation: 727
When I run a python script I want 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
Upvotes: 0
Views: 381
Reputation: 93410
./pyscript.py &> output.txt
or:
python script.py &> output.txt
Note: redirects both stdout and stderr to output.txt.
Upvotes: 0
Reputation: 32429
Try:
python -u yourscript.py 1> log 2> err
Or for appending
python -u yourscript.py 1>> log 2>> err
Upvotes: 1