>> Error: >> ./python2.py: line 1: syntax error near unexpected token `(' > > That is not a Python error, that's a complaint of your shell. > If you make a Python script executable you also have to insert the proper > hash-bang line. In the case of Python 2 > > #!/usr/bin/python2 > > will probably work. Example shell session: > > $ cat tmp.py > def demo(): > print "heureka" > > demo() > $ ./tmp.py > ./tmp.py: line 1: syntax error near unexpected token `(' > ./tmp.py: line 1: `def demo():' or, of course, run it with python explicitly:
$ python tmp.py _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor