From bdb57a9707bd2c6da133367ff2b468903186e353 Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Fri, 13 Nov 2015 18:10:05 -0800 Subject: [PATCH] Fixed input bug. --- jarvis.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jarvis.py b/jarvis.py index 646ebd0..3163b09 100644 --- a/jarvis.py +++ b/jarvis.py @@ -3,6 +3,11 @@ import json import apis +# Fix Python 2.x. Yingchong Qiu + Mudit Mittal +try: + input = raw_input +except NameError: + pass def square(n): """ Square numbers @@ -33,7 +38,6 @@ def dispatcher(command, arg): def prompter(): """ asks for things """ - command = input("How may I help you?: [weather, square, go away, bye]") if command == "weather": city = input("Sure thing! What city?")