{"id":909,"date":"2021-04-25T04:58:14","date_gmt":"2021-04-25T04:58:14","guid":{"rendered":"https:\/\/usemynotes.com\/?p=909"},"modified":"2024-10-27T20:33:14","modified_gmt":"2024-10-27T15:03:14","slug":"what-is-a-python-interpreter","status":"publish","type":"post","link":"https:\/\/usemynotes.com\/what-is-a-python-interpreter\/","title":{"rendered":"What is Python Interpreter?"},"content":{"rendered":"<p>Hey Guys, in this module, we will discuss <strong>what is Python Interpreter<\/strong>, how we can run our code in Python, and much more. We have already talked about <a href=\"https:\/\/usemynotes.com\/how-to-set-up-python-environment\/\">Python environment set-up<\/a> in a few systems.\u00a0So, let\u2019s start and learn about Python Interpreter.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/usemynotes.com\/what-is-a-python-interpreter\/#What_is_Python_Interpreter\" >What is Python Interpreter?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/usemynotes.com\/what-is-a-python-interpreter\/#How_to_run_Python_Shell\" >How to run Python Shell?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/usemynotes.com\/what-is-a-python-interpreter\/#Online_Python_Compiler\" >Online Python Compiler<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/usemynotes.com\/what-is-a-python-interpreter\/#How_to_install_Anaconda\" >How to install Anaconda?<\/a><\/li><\/ul><\/nav><\/div>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"What_is_Python_Interpreter\"><\/span><strong>What is Python Interpreter?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Python executes the code line by line i.e., Python is an interpreter language. As we know the computer can\u2019t understand our language, it can only understand the machine language i.e., binary language. So, the Python interpreter converts the code written in python language by the user to the language which computer hardware or system can understand. It does all the time whenever you run your python script.<\/p>\n<figure id=\"attachment_910\" aria-describedby=\"caption-attachment-910\" style=\"width: 1000px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-910 size-full\" title=\"what is python interpreter\" src=\"https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/what-is-python-interpreter.jpg\" alt=\"What is Python interpreter?\" width=\"1000\" height=\"600\" srcset=\"https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/what-is-python-interpreter.jpg 1000w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/what-is-python-interpreter-300x180.jpg 300w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/what-is-python-interpreter-768x461.jpg 768w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/what-is-python-interpreter-150x90.jpg 150w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/what-is-python-interpreter-696x418.jpg 696w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/what-is-python-interpreter-700x420.jpg 700w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption id=\"caption-attachment-910\" class=\"wp-caption-text\">What is Python interpreter?<\/figcaption><\/figure>\n<p>We write the Python code in any text editor and save the same file using the \u201c.py\u201d extension in our system. Now, how will this code run? There must be some application or program like \u201cpython\u201d or \u201cpython3\u201d that must be installed in your system, and it is their duty to run this python code. This type of program is called an Interpreter.<\/p>\n<p>Python does provide a Python shell, which is used to execute a single command in Python and display the result accordingly.<\/p>\n<p>The Python interpreter first reads the command, then evaluates the command, prints the results, and then again loops it back to read the command and because of this only Python is known as REPL i.e., (Read, Evaluate, Print, Loop).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_run_Python_Shell\"><\/span>How to run Python Shell?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To run a Python shell, follow the given steps below.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-913 aligncenter\" src=\"https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-run-python-shell.jpg\" alt=\"how to run python shell\" width=\"1235\" height=\"696\" title=\"\" srcset=\"https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-run-python-shell.jpg 1235w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-run-python-shell-300x169.jpg 300w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-run-python-shell-1024x577.jpg 1024w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-run-python-shell-768x433.jpg 768w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-run-python-shell-150x85.jpg 150w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-run-python-shell-696x392.jpg 696w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-run-python-shell-1068x602.jpg 1068w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/how-to-run-python-shell-745x420.jpg 745w\" sizes=\"(max-width: 1235px) 100vw, 1235px\" \/><\/p>\n<ul>\n<li>Open the power shell or command prompt on Windows, and the terminal window on Mac.<\/li>\n<li>Write Python there and then press enter.<\/li>\n<li>A Python prompt consisting of three greater-than symbols i.e., \u201c&gt;&gt;&gt;\u201d appears.<\/li>\n<li>Now, just enter the single statement and see the results accordingly. For example, enter a single statement like 3 + 2 or 3 * 2 and then press enter, the result will appear in the next line respectively.<\/li>\n<\/ul>\n<p>This was all about executing a single statement but what happens if you want to execute multiple statements in a single run or you want to build some <a href=\"https:\/\/usemynotes.com\/what-are-the-applications-of-python\/\">applications in Python<\/a> for that you need to follow the mentioned steps below.<\/p>\n<ul>\n<li>Open notepad or any text editor.<\/li>\n<li>Write the code using <a href=\"https:\/\/usemynotes.com\/introduction-to-python\/\">Python<\/a> language. For example:\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nprint(\u201cWelcome to Use My Notes\u201d);\r\nprint(\u201cNotes simplified for learners\u201d);\r\n<\/pre>\n<\/li>\n<li>Save that file using the \u201c.py\u201d extension.<\/li>\n<li>Open the shell or command prompt.<\/li>\n<li>Now navigate the command prompt to the path where you have saved the file, execute the command python file_name.py, and press enter.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Online_Python_Compiler\"><\/span>Online Python Compiler<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Apart from these, many more Python interpreters are available like you can go for an <strong>online Python compiler<\/strong>. There are many online compilers available, in this case, you don\u2019t need to install anything in your system, To access an online compiler follow the given steps.<\/p>\n<ul>\n<li>Open google.com<\/li>\n<li>Type online Python compiler. The list of compilers will be opened.<\/li>\n<li>Go for the first one and start typing your code there.<\/li>\n<\/ul>\n<p>The main drawback of using an online compiler is that you can\u2019t be able to save your code on your local machine or system. The code is available till the compiler is opened in your browser, and once the compiler is closed the code is lost.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_install_Anaconda\"><\/span>How to install Anaconda?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Other interpreters are Jupyter Notebook and Spider, so to access all these you need to install the anaconda in your system and follow the given steps.<\/p>\n<ul>\n<li>Open https:\/\/docs.anaconda.com\/anaconda\/install\/windows\/<\/li>\n<li>Then click on Windows installation.<\/li>\n<li>After installation is done, you can go for the Jupyter notebook there, and start coding.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"size-full wp-image-911 aligncenter\" src=\"https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/jupyter-notebook.jpg\" alt=\"jupyter notebook\" width=\"1242\" height=\"701\" title=\"\" srcset=\"https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/jupyter-notebook.jpg 1242w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/jupyter-notebook-300x169.jpg 300w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/jupyter-notebook-1024x578.jpg 1024w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/jupyter-notebook-768x433.jpg 768w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/jupyter-notebook-150x85.jpg 150w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/jupyter-notebook-696x393.jpg 696w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/jupyter-notebook-1068x603.jpg 1068w, https:\/\/usemynotes.com\/wp-content\/uploads\/2021\/04\/jupyter-notebook-744x420.jpg 744w\" sizes=\"(max-width: 1242px) 100vw, 1242px\" \/><\/p>\n<p>I hope you all liked <strong>what is Python interpreter<\/strong> module is and must be very much excited to start your journey toward this wonderful programming language called Python. So, stay connected with us, from the next module, we are going to move in more depth toward our learning. Until then stay safe, stay healthy, keep reading, and enjoy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey Guys, in this module, we will discuss what is Python Interpreter, how we can run our code in Python, and much more. We have already talked about Python environment set-up in a few systems.\u00a0So, let\u2019s start and learn about Python Interpreter. What is Python Interpreter? Python executes the code line by line i.e., Python [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":910,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":{"0":"post-909","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"_links":{"self":[{"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/posts\/909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/comments?post=909"}],"version-history":[{"count":0,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/posts\/909\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/media\/910"}],"wp:attachment":[{"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/media?parent=909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/categories?post=909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/usemynotes.com\/wp-json\/wp\/v2\/tags?post=909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}