On 08/02/2012 11:49 AM, Ulrich Eckhardt wrote: > try: > # redirect input() to raw_input() like Python 3 > input = raw_input > except NameError: > # no raw input, probably running Python 3 already > pass > What do you think? Any better alternatives?
That's the generic solution, see http://python3porting.com/differences.html#input-and-raw-input . In my experience, it seems that input's main function is to allow beginners to learn the language, or to be used in short scripts. For a serious application, either curses or moving the input to the invocation arguments is often a better choice. - Philipp
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list