{"id":33,"date":"2020-12-11T16:13:49","date_gmt":"2020-12-11T16:13:49","guid":{"rendered":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/beta.python3.guide\/wordpress\/?page_id=33"},"modified":"2021-10-26T11:04:46","modified_gmt":"2021-10-26T09:04:46","slug":"starting-python","status":"publish","type":"post","link":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/installing-python\/starting-python","title":{"rendered":"How To Open Python on Windows, Mac, Linux"},"content":{"rendered":"\n<p>You&#8217;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:<\/p>\n\n\n\n<ol><li>Start an interactive shell, also called a REPL, short for read-evaluate-print-loop.<\/li><li>Start a Python program that you stored in one or more files with the .py extension.<\/li><\/ol>\n\n\n\n<p>In this tutorial, we\u2019ll start with the interactive shell because it\u2019s ideal for exploring the language. But at some point, using the REPL won&#8217;t cut it anymore and you&#8217;ll have to start creating Python files.<\/p>\n\n\n\n<p>If you <a href=\"https:\/\/python.land\/installing-python\">installed Python<\/a> 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\u00a0<code>python3<\/code>\u00a0(or sometimes just\u00a0<code>python<\/code>). Just\u00a0<a href=\"https:\/\/python.land\/migrating-from-python-2-to-3\/how-to-check-your-python-version\">be sure you are running Python 3, not 2<\/a>, because some systems can have both versions installed.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_17 counter-hierarchy counter-decimal ez-toc-transparent\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">Table of contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/python.land\/installing-python\/starting-python\/#How_to_open_Python_on_Linux\" title=\"How to open Python on Linux\">How to open Python on Linux<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/python.land\/installing-python\/starting-python\/#How_to_open_Python_on_Windows\" title=\"How to open Python on Windows\">How to open Python on Windows<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/python.land\/installing-python\/starting-python\/#How_to_open_Python_on_Mac\" title=\"How to open Python on Mac\">How to open Python on Mac<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/python.land\/installing-python\/starting-python\/#How_to_use_Python_in_the_cloud_replit\" title=\"How to use Python in the cloud (repl.it)\">How to use Python in the cloud (repl.it)<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<h2 id=\"h-how-to-open-python-on-linux\"><span class=\"ez-toc-section\" id=\"How_to_open_Python_on_Linux\"><\/span>How to open Python on Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>On Linux, you first need to start a terminal. This can often be done with the shortcut\u00a0<strong><code>ctrl<\/code>\u00a0+\u00a0<code>alt<\/code>\u00a0+\u00a0<code>T<\/code><\/strong>. 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, enter\u00a0<code>python3<\/code>\u00a0to start the Python REPL. If that doesn&#8217;t work, try <code>python<\/code> instead (without the 3).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" width=\"694\" height=\"503\" src=\"https:\/\/python.land\/wp-content\/uploads\/2020\/12\/python-on-linux.png\" alt=\"\" class=\"wp-image-289\" srcset=\"https:\/\/python.land\/wp-content\/uploads\/2020\/12\/python-on-linux.png 694w, https:\/\/python.land\/wp-content\/uploads\/2020\/12\/python-on-linux-600x435.png 600w, https:\/\/python.land\/wp-content\/uploads\/2020\/12\/python-on-linux-300x217.png 300w\" sizes=\"(max-width: 694px) 100vw, 694px\" \/><figcaption>Python running in a Linux terminal<\/figcaption><\/figure><\/div>\n\n\n\n<h2 id=\"h-how-to-open-python-on-windows\"><span class=\"ez-toc-section\" id=\"How_to_open_Python_on_Windows\"><\/span>How to open Python on Windows<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>On Windows, you can start Python from a terminal as well. E.g., to start PowerShell simply hit the Windows key and start typing &#8220;PowerShell&#8221;. Start it and then enter\u00a0<code>python3<\/code> or <code>python<\/code> (whichever works). If you don&#8217;t have PowerShell, you can use the &#8216;Command Prompt&#8217; program instead.<\/p>\n\n\n\n<p>If the python3 command doesn&#8217;t work or opens the Windows store, you probably used the installer from python.org. In that case, simply try <code>python<\/code> instead (without the 3).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" src=\"https:\/\/python.land\/wp-content\/uploads\/2020\/12\/python-in-windows-powershellpng-1024x668.png\" alt=\"Python started from Windows PowerShell\" class=\"wp-image-290\" width=\"700\" height=\"500\"\/><figcaption>Python started from Windows PowerShell<\/figcaption><\/figure><\/div>\n\n\n\n<h2 id=\"h-how-to-open-python-on-mac\"><span class=\"ez-toc-section\" id=\"How_to_open_Python_on_Mac\"><\/span>How to open Python on Mac<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>On MacOS, search for a program called terminal. You can do so by pressing the <strong>command key (\u2318)<\/strong> + <strong>space bar<\/strong>. This will open up the Spotlight search bar, in which you start typing the word &#8216;terminal&#8217;.<\/p>\n\n\n\n<p>Once you started the terminal, enter <code>python3<\/code> to open the Python REPL. If that doesn&#8217;t work, try entering <code>python<\/code> instead (without the 3).<\/p>\n\n\n\n<h2 id=\"h-how-to-use-python-in-the-cloud-repl-it\"><span class=\"ez-toc-section\" id=\"How_to_use_Python_in_the_cloud_replit\"><\/span>How to use Python in the cloud (repl.it)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you decided to use the <a href=\"https:\/\/repl.it\/new\/python3\" target=\"_blank\" rel=\"noreferrer noopener\">repl.it cloud-based option<\/a>, the Python interactive shell is at the right of the screen. You can simply click in the dark shell area and start typing:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" src=\"https:\/\/python.land\/wp-content\/uploads\/2020\/12\/repl.it.png\" alt=\"On repl.it, the Python REPL is at the right of your screen\" class=\"wp-image-284\" width=\"700\" height=\"500\"\/><figcaption>On repl.it, the Python REPL is at the right of your screen<\/figcaption><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>You&#8217;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 &#8230; <a title=\"How To Open Python on Windows, Mac, Linux\" class=\"read-more\" href=\"https:\/\/python.land\/installing-python\/starting-python\" aria-label=\"More on How To Open Python on Windows, Mac, Linux\">read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":2491,"parent":27,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[30],"tags":[29],"modified_by":"Erik van Baaren","menu_order":2,"_links":{"self":[{"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/posts\/33"}],"collection":[{"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":4,"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":2852,"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/posts\/33\/revisions\/2852"}],"up":[{"embeddable":true,"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/posts\/27"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/media\/2491"}],"wp:attachment":[{"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/python.land\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/web.archive.org\/web\/20211027042030\/https:\/\/api.w.org\/{rel}","templated":true}]}}