r/pythontips • u/MonkHaus • Jan 30 '20
Python Command line
To catch any syntax errors before executing large time consuming scripts you can run the following from your command line
python3 -m py_compile my_script.py
38
Upvotes
r/pythontips • u/MonkHaus • Jan 30 '20
To catch any syntax errors before executing large time consuming scripts you can run the following from your command line
python3 -m py_compile my_script.py
13
u/gedon Jan 30 '20
An even better way is to use a decent IDE such as pycharm. You can run in debug mode or even just set break points and step through your code.