How to Run a Python File in Terminal?

Open Terminal

Navigate to the folder containing the Python file using `cd`

Run the file with `python filename.py`

If needed, use `python3 filename.py`

Press Enter

Suggested for You

Trending Today