This wikiHow teaches you different ways to open and run a Python script on Windows, macOS, and Linux systems. Simply installing the latest version of Python 3 from Python.org (or by using your Linux distribution's package manager) gives...
Using IDLE
Install Python 3 with IDLE on your computer. If you haven't already done so, you'll need to install the latest version of Python (which is 3.8.3 as of 5/20/2020), which comes with an Integrated Development Environment (IDE) called IDLE. Here's how to get it:
Open IDLE on your computer. If you're using a Mac, it'll now be on the Launchpad as well as in the Applications folder. If you're using Windows, you'll find it the Start menu. If you're using Linux, just type idle at the command prompt and press the Enter key.

Click the File menu. It's at the top-left corner of the screen on a Mac, and at the top-left corner of IDLE in Windows or Linux.

Click Open. The file picker will appear.
Select your Python file and click Open. The script should end with the ".py" file extension. This opens the script for editing.
Click the Run menu. It's in the menu bar at the top of the screen (or at the top of IDLE in Windows and Linux).

Click Run Module. This runs your Python script in IDLE.
Using Python at the Command Line
Install Python 3 if you haven't already. If you're just getting started with Python, make sure you install the latest version before you continue.
Open Terminal (macOS/Linux) or Command Prompt (Windows). Here's how:
Use the cd command to enter the directory that contains your Python file. The file you're looking for should end with the ".py" file extension.
Type python and press Enter or Return. For example, if the file is called script.py, you'd type python script.py. This runs the script in Python.Using Python Launcher for Windows or macOS
Install Python 3 if you haven't already done so. If you don't have Python 3 installed, you can get it from https://python.org.
Navigate to your Python script in Finder or File Explorer. The file should end with the ".py" file extension.

Right-click the Python file and select Open With. A list of applications will expand.
Click Python Launcher. This runs the script in Python Launcher.Update 02 June 2020
ncG1vNJzZmismaXArq3KnmWcp51ktbDDjK2mZqegmrturYypsK2gn6N6p7XLng%3D%3D