syntax error when using command line in python

Looks like your problem is that you are trying to run python test.py from within the Python interpreter, which is why you’re seeing that traceback.

Make sure you’re out of the interpreter, then run the python test.py command from bash or command prompt or whatever.

Leave a Comment