Windows redirect stdout and stderr to a file

I'm trying to redirect the output of a python script to a file. I have run:

C:>python c:python_script.py > a.txt 2>&1

Found here but output is only written once the process completes or is killed. Is there a way to have the redirection write to file as output is written to stdout & stderr?

链接地址: http://www.djcxy.com/p/92310.html

上一篇: Windows cmd将子命令输出重定向到文件

下一篇: Windows将stdout和stderr重定向到一个文件