Catching Errors

Alex Martelli aleaxit at yahoo.com
Sun Jun 10 21:35:10 CEST 2001


"Emile van Sebille" <emile at fenx.com> wrote in message
news:9fqpii$5mk9n$1 at ID-11957.news.dfncis.de...
> If you want to capture error output to a file, you can also try:
>
> c:\> python errors-catch.py 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.


Alex






More information about the Python-list mailing list