Install Python from python.org or your system package manager
Save your code in a file with a .py extension
Open a terminal or command prompt
Navigate to the folder containing the file
Run python filename.py
If needed, use python3 filename.py
Verify Python is installed with python –version or python3 –version
Install required packages with pip install package_name
Activate a virtual environment if you are using one
Run the script again after making changes
