How To Open Python on Windows, Mac, Linux

You’ll now learn how to open Python on Linux, Windows, and MacOS. First of all, you should know that there are two ways of using Python:

  1. Start an interactive shell, also called a REPL, short for read-evaluate-print-loop.
  2. Start a Python program that you stored in one or more files with the .py extension.

In this tutorial, we’ll start with the interactive shell because it’s ideal for exploring the language. But at some point, using the REPL won’t cut it anymore and you’ll have to start creating Python files.

If you installed Python on your local machine, you first need to start a terminal or command prompt before you can start the Python interactive shell. On all platforms, you should be able to start Python 3 with the command python3 (or sometimes just python). Just be sure you are running Python 3, not 2, because some systems can have both versions installed.

How to open Python on Linux

On Linux, you first need to start a terminal. This can often be done with the shortcut ctrl + alt + T. Alternatively, you can search for the terminal program in your start menu. The name and where to find it differs from distribution to distribution. Once you have a terminal running, simple enter python3 to start the Python REPL:

Python running in a Linux terminal

How to open Python on Windows

On Windows, you can start Python from a terminal as well. E.g., to start PowerShell, simply hit the Windows key and start typing “PowerShell”. Start it and then enter python3. If you don’t have PowerShell, you can use the ‘Command Prompt’ program instead.

Python started from Windows PowerShell
Python started from Windows PowerShell

How to open Python on Mac

On MacOS, search for a program called terminal. You can do so by pressing the command key (⌘) + space bar. This will open up the Spotlight searchbar, in which you start typing the word ‘terminal’.

Once you started the terminal, enter python3 to open the Python REPL.

How to use Python in the cloud (repl.it)

If you decided to use the repl.it cloud-based option, the Python interactive shell is at the right of the screen. You can simply click in the dark shell area and start typing:

On repl.it, the Python REPL is at the right of your screen
On repl.it, the Python REPL is at the right of your screen

Please help us and share this article

About the author

Erik is the owner of Python Land and the author of many of the articles and tutorials on this website. He's been working as a professional software developer for 25 years, and he holds a Master of Science degree in computer science. His favorite language of choice: Python!