Commits

Matt Bone committed 32dc2c8

works in python2 and python3

  • Participants
  • Parent commits 3a21655

Comments (0)

Files changed (2)

in_py/parse_sexp.py

 def char_to_token(char):
     matches = []
 
-    for regex, klass in RE_TO_TOKEN_MAP.iteritems():
+    for regex, klass in RE_TO_TOKEN_MAP.items():
         if(regex.match(char)):
             matches.append(klass(char))
 
 
 from parse_sexp import sexp_to_tree
 
+import sys
+
 if __name__ == '__main__':
     while(True):
         print("=> ", end="")
-        sexp = raw_input()
+        sys.stdout.flush()
+        sexp = sys.stdin.readline().strip()
         print(sexp_to_tree(sexp))