Catching Errors

Alex Martelli aleaxit at
Sun Jun 10 15:35:10 EDT 2001

"Emile van Sebille" <emile at> wrote in message
news:9fqpii$5mk9n$1 at
> If you want to capture error output to a file, you can also try:
> c:\> python 2>errors.txt

That doesn't help on Windows/98 (nor on NT, I think), as would
seem to be suggested from the 'c:\>' prompt...:

D:\py21>python -c "import sys;print>>sys.stderr,sys.argv" 2>oo.txt
['-c', '2']

D:\py21>dir oo.txt

 Volume in drive D is DISCO D
 Volume Serial Number is 4140-11E0
 Directory of D:\py21

OO       TXT             0  06-10-01  9:32p oo.txt
         1 file(s)              0 bytes
         0 dir(s)     354,697,216 bytes free

The '2' becomes a program-argument and the redirection is of
standard-output anyway.


More information about the Python-list mailing list