sys.stdin.read() replacement

Michael Hudson mwh at python.net
Wed Aug 18 07:38:11 EDT 2004


"Ben Last" <ben at benlast.com> writes:

> import readline will work on Windows:
> a) if you're running the cygwin python, inside cygwin
> b) if you've installed a readline module; there are at least two available.
> Excuse me for the self-referential answer, but about half and hour before I
> read this, I wrote a blog entry all about readline modules, with links to
> and comments about the Windows ones.  The permalink is
> http://www.livejournal.com/users/benlast/16766.html or it's the most recent
> entry at http://www.livejournal.com/users/benlast/
> 
> Karin: if you do import a readline, you can then use sys.stdin.readline() to
> read a line of input, and you should get some sort of history functionality
> (up-arrow, for example, will recall a previous line).

Uh, I don't think this is the case; sys.stdin.readline() never uses
the readline functionality.  Do you mean raw_input()?

Cheers,
mwh

-- 
8. A programming language is low level when its programs require
   attention to the irrelevant.
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html



More information about the Python-list mailing list