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.
More Related Contents:
- (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated \UXXXXXXXX escape [duplicate]
- How do I access command line arguments?
- What is the purpose of the -m switch?
- Run function from the command line
- Python not working in the command line of git bash
- How to correct TypeError: Unicode-objects must be encoded before hashing?
- What’s the best way to parse command line arguments? [closed]
- Executing multi-line statements in the one-line command-line
- SyntaxError: multiple statements found while compiling a single statement
- Cannot redirect output when I run Python script on Windows using just script’s name
- Python subprocess and user interaction
- Value error trying to install Python for Windows extensions
- Python, installing clarifai –> VS14.0 link.exe failed with exit status 1158
- ‘yes’ reporting error with subprocess communicate()
- How to pass dictionary as command line argument to Python script?
- Full command line as it was typed
- How to plot a chart in the terminal
- Why can’t attribute names be Python keywords?
- Why do I get the syntax error “SyntaxError: invalid syntax” in a line with perfectly valid syntax?
- Read Unicode characters from command-line arguments in Python 2.x on Windows
- Command-line input causes SyntaxError
- Why am I getting “invalid syntax” from an f-string? [duplicate]
- Ampersand “&” syntax error running any Python script in VSCode?
- Why do parentheses in a lambda function cause syntax error on Python 3? [duplicate]
- Launch Pycharm from command line (terminal)
- How to add to and remove from system’s environment variable “PATH”?
- How to find which version of TensorFlow is installed in my system?
- running a command line containing Pipes and displaying result to STDOUT
- subprocess call ffmpeg (command line)
- Command line execution in different folder