Python's import: why doesn't it work?

Guy Rabiller grabiller at 3dvf.net
Mon Sep 30 01:47:28 CEST 2002


[ Jurie Horneman]
> python -v script.py >output.txt
>
> It lists the verbose output straight to the DOS shell, not to
> output.txt. The output is useless, I can't scroll back.

try:

python -v script.py 2> output.txt


--
guy rabiller
3d animator / td
grabiller at 3dvf.net
http://grabiller.3dvf.net

Tim Peters wrote:
> [ Jurie Horneman]
>> Actually, I just tried this in a DOS shell under Windows 98:
>>
>> python -v script.py >output.txt
>>
>> It lists the verbose output straight to the DOS shell, not to
>> output.txt. The output is useless, I can't scroll back.
>>
>> Oddly,
>>
>> python -h >output.txt
>>
>> correctly sends the output to output.txt.
>>
>> Does anybody know if this is a bug,
>
> Arguably so, but it's a command.com (the Win9x shell) limitation.
> Your first example printed to stdout, your second to stderr, and
> command.com simply doesn't allow redirecting stderr, or setting the
> DOS box history to a usable value.  cmd.exe (the WinNT/2K/XP shell)
> does both.
>
>> and how I can work around it?
>
> Programming life under command.com is impossible without tcap:
>
>     http://www.simtel.net/pub/pd/11141.html
>
> It's free, tiny, and works great.  It's the only Win9x "console
> capturing" utility I've tried that actually works, and doesn't cause
> system instability.





More information about the Python-list mailing list