raw_input - why doesn't prompt go to stderr
Terry Reedy
tjreedy at udel.edu
Tue Jan 27 17:26:07 EST 2004
"Helmut Jarausch" <jarausch at skynet.be> wrote in message
news:4016A585.6050109 at skynet.be...
> Ofcourse I did the redirection of stdout.
Since a program author can easily do so, as has been posted more than once
over the years, the question was real. In fact, the addition of '>>ofile'
to print statements was intended to make such redirection less common.
> And this is very handy.
> While testing I don't redirect stdout and so can see the output
> immediately. Then I just redirect stdout for a 'production' run.
>
> Tell me any advantage in raw_input's prompt is going to stdout instead
> of stderr?
I don't know the ramification of the distinction, expecially across
platforms, well enough to answer. I can only reiterate my suggestion,
given Python as it is today and will remain for some time, that you print
to 'ofile' with default ofile == sys.stdout but with command line or
interactive redirection.
Terry J. Reedy
More information about the Python-list
mailing list