Catching Errors
Emile van Sebille
emile at fenx.com
Sun Jun 10 17:14:02 EDT 2001
You're right, I didn't test using win9x. It does work on win2k, which is on
most of the systems I use regularly. It also works on winnt, although I
only tried:
C:\>python 2>errors.txt
on a system I don't have python installed on. (WinNT Terminal Server).
The different handling of arguments on win9x and the winnt families is
certainly unexpected.
--
Emile van Sebille
emile at fenx.com
---------
"Alex Martelli" <aleaxit at yahoo.com> wrote in message
news:9g0idm01lap at enews1.newsguy.com...
> "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