raw_input(), STRANGE behaviour
gagsl-py2 at yahoo.com.ar
Sun Jan 27 19:55:18 CET 2008
En Sun, 27 Jan 2008 12:51:51 -0200, Dox33 <Rens.Duijsens at gmail.com>
> Yes, I know.
> There are several ways to work around the problem.
> (Look at the innitial code I provided in this discussion start)
> Fact is, every time I'm getting a script from somewhere or someone, I
> have to search and replace all the affected code.
> Not very conveniant.
> That's why I rather would have a correct working version.
Add this on your sitecustomize.py module (or create one)
if prompt: sys.stdout.write(prompt)
original_raw_input = __builtin__.raw_input
__builtin__.raw_input = raw_input
It just replaces the builtin raw_input with a custom function.
More information about the Python-list