According to the manual, raw_input
writes to stdout. I have this little program (test_raw_input.py
):
# Test if rawinput writes to stdout or stderr
raw_input('This is my prompt > ')
And no matter how I run this:
$ python test_raw_input.py > xxx
or
$ python test_raw_input.py 2> xxx
The prompt always ends up in xxx
. Why is this happening?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…