[Tutor] stderr

Joseph J. Strout joe@strout.net
Tue, 13 Apr 1999 08:32:21 -0700


At 8:24 AM -0700 04/13/99, Arne Mueller wrote:

>is there an easy way like in C or perl to use 'print' to write to stderr
>instead stdout?

=)  C doesn't have anything as simple as "print".  (Don't know perl.)

>assigning sys.stdout to sys.stderr is not a good solution. I dont want
>to reassign stderr/stdout everytime I switch between error messages and
>data output.

You can use sys.stdout.write("%s\n" % errmsg), or you can make a function
which does basically the same thing.

Cheers,
-- Joe
,------------------------------------------------------------------.
|    Joseph J. Strout           Biocomputing -- The Salk Institute |
|    joe@strout.net             http://www.strout.net              |
`------------------------------------------------------------------'