Can't redirect output

Chris Gonnerman chris.gonnerman at usa.net
Sat Feb 24 01:03:31 EST 2001


----- Original Message -----
From: "Robert Olney" <rolney at pcug.org.au>
Subject: Re: Can't redirect output
> >> I am running Python 2.0 on Windows 98. When I try to redirect output
> >> from a command prompt, e.g.
> >>
> >> C:\> python hello.py > out.txt
> >>
> >> the output is printed on the screen and not to the file. Why?
> >
> I am using normal print commands.
>
> Hello.py:
> print "Hello"

Huh.  I just put that single line (print "Hello") into a script file and did

    python Hello.py > out.txt

as you specified, and it worked find.  I'm using BeOpen Python 2.0 on
Windows 98.
The same code works fine under Python 1.5.2 on Linux 2.2.

I'm puzzled.  Can you try this on a different Win98 computer?  Do you have a
keyboard
or console redirector running (not DOSKEY but a clone)?  Are you running
COMMAND.COM, 4DOS, Win95CMD.exe, or what?  Can you think of anything
unusual about your console configuration?

> I have now found I can't redirect this under DOS (python 1.5.2)
> either.

I've never tried the DOS version, so I can't comment here.





More information about the Python-list mailing list