open() and EOFError

Roy Smith roy at panix.com
Wed Jul 9 03:05:12 CEST 2014


In article <mailman.11636.1404834458.18130.python-list at python.org>,
 Tim Chase <python.list at tim.thechases.com> wrote:

> On 2014-07-09 01:24, Chris Angelico wrote:
> > On Wed, Jul 9, 2014 at 1:20 AM, Tim Chase
> > > Okay, EOF is the canonical way to tell a program reading stdin
> > > that you're done.  It just happens that EOF ^D on *nix-likes and
> > > ^Z on Win32. :-)
> > >
> > > -tkc
> > 
> > I can't think of any Windows-native programs that ask for EOF. Only
> > those which came from POSIX platforms do it. That said, though,
> > Windows doesn't tend to encourage interactive command-line programs
> > at all, so you may as well just follow the Unix convention.
> 
> There was a time in life where I used "copy con output.txt" on a
> disturbingly frequent basis.  Control+Z ended my file for me.
> 
> -tkc

I once knew a guy who linked /dev/tty.c to /dev/tty, then he could do 
"cc /dev/tty.c" and type a C program in to the compiler from the 
terminal.



More information about the Python-list mailing list