How to Run PY File?

Install Python

Open Terminal or Command Prompt

Navigate to the folder containing the .py file

Run `python filename.py`

If needed, run `python3 filename.py`

On Windows, try `py filename.py`

If using an IDE, click Run

If the file is executable on Linux or macOS, run `chmod +x filename.py` then `./filename.py`

Suggested for You

Trending Today