On Fri, May 3, 2013 at 5:16 PM, dabaichi <valben...@outlook.com> wrote: > Hello guys: > Do you have found that the built-in input() function is dangerous. > Here is my code(python 2.x only): > > a = input("Input anything:") > print("go here") > > If I input: > sys.exit(0) > print("go here") will not be execute, and the script will exit.
Yeah, that's kinda discovered. In Python 2, you should be using raw_input() for that kind of thing. In Python 3, raw_input() was renamed to input(), and if you want the semantics of Py2 input(), it's eval(input()), which makes it obvious what's going on. ChrisA -- http://mail.python.org/mailman/listinfo/python-list