Alternative to raw_input ?

Michael Hoffman cam.ac.uk at mh391.invalid
Sun Feb 13 21:26:29 EST 2005


Francis Girard wrote:
> [den]:
> 
>>import msvcrt
>>msvcrt.getch()
> 
> I frequently had the problem to have something similar but *portable*.
> Something as short and simple.

This has been brought up many times on this newsgroup. The answer is that
there is no simple way to do this portably. You could use Python's
exception handling to create a version that runs on multiple systems
though, falling back to another method if msvcrt can't be imported.
-- 
Michael Hoffman



More information about the Python-list mailing list