[Tutor] Script won't run for no apparent reason

Wayne Werner wayne at waynewerner.com
Sat Aug 11 05:35:12 CEST 2012


On Fri, 10 Aug 2012, Dave Angel wrote:

> On 08/10/2012 03:53 PM, Joel Goldstick wrote:
<snip>
> The clue was actually in his code.  See his shebang line -- he's using
> Python 3.  So the error is on the data that the user inputs.
> The other clue, that I noticed, was that his innermost error was on line
> 1, "called" from input().
> Anyway, the cure is to use raw_input() everywhere instead.

Or alternatively, if you want to write forward-looking code:

try:
     input = raw_input
except NameError:
     pass # since we're using python 3+

-Wayne


More information about the Tutor mailing list