{"id":64621,"date":"2024-10-12T16:42:36","date_gmt":"2024-10-12T16:42:36","guid":{"rendered":"https:\/\/puresourcecode.com\/?p=64621"},"modified":"2024-10-12T16:42:40","modified_gmt":"2024-10-12T16:42:40","slug":"hello-python","status":"publish","type":"post","link":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/","title":{"rendered":"Hello Python"},"content":{"rendered":"\n<p>Hello <a rel=\"nofollow\" href=\"https:\/\/puresourcecode.com\/programming-languages\/python\/getting-started-with-python\/\">Python<\/a>! is a new thread in my blog. I started to learn this programming language a few months ago but now I have to use it for university. So, I have to practice.<\/p>\n\n\n\n<p>Python differs slightly on different operating systems, so you\u2019ll need to keep a few considerations in mind. In the following sections, we\u2019ll make sure Python is set up correctly on your system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h2-502703c01-0001\">Python Versions<\/h2>\n\n\n\n<p>Every programming language evolves as new ideas and technologies emerge, and the developers of Python have continually made the language more versatile and powerful. As of this writing, the latest version is Python 3.11, but everything in this book should run on Python 3.9 or later. In this section, we\u2019ll find out if Python is already installed on your system and whether you need to install a newer version.&nbsp;Appendix A&nbsp;contains additional details about installing the latest version of Python on each major operating system as well.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h2-502703c01-0002\">Running Snippets of Python Code<\/h2>\n\n\n\n<p>You can run Python\u2019s interpreter in a terminal window, allowing you to try bits of Python code without having to save and run an entire program.<\/p>\n\n\n\n<p>Throughout this book, you\u2019ll see code snippets that look like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; print(&quot;Hello Python interpreter!&quot;)\nHello Python interpreter!\n<\/pre><\/div>\n\n\n<p>The three angle brackets (<code>&gt;&gt;&gt;<\/code>) prompt, which we\u2019ll refer to as a&nbsp;<em>Python prompt<\/em>, indicates that you should be using the terminal window. The bold text is the code you should type in and then execute by pressing ENTER. Most of the examples in this book are small, self-contained programs that you\u2019ll run from your text editor rather than the terminal, because you\u2019ll write most of your code in the text editor. But sometimes, basic concepts will be shown in a series of snippets run through a Python terminal session to demonstrate particular concepts more efficiently. When you see three angle brackets in a code listing, you\u2019re looking at code and output from a terminal session. We\u2019ll try coding in the interpreter on your system in a moment.<\/p>\n\n\n\n<p>We\u2019ll also use a text editor to create a simple program called&nbsp;<em>Hello World!<\/em>&nbsp;that has become a staple of learning to program. There\u2019s a long-held tradition in the programming world that printing the message&nbsp;<code>Hello world!<\/code>&nbsp;to the screen as your first program in a new language will bring you good luck. Such a simple program serves a very real purpose. If it runs correctly on your system, then any Python program you write should work as well.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h2-502703c01-0003\">About the VS Code Editor<\/h2>\n\n\n\n<p><em>VS Code<\/em>&nbsp;is a powerful, professional-quality text editor that\u2019s free and beginner-friendly. VS Code is great for both simple and complex projects, so if you become comfortable using it while learning Python, you can continue using it as you progress to larger and more complicated projects. VS Code can be installed on all modern operating systems, and it supports most programming languages, including Python.<\/p>\n\n\n\n<p>Appendix B&nbsp;provides information on other text editors. If you\u2019re curious about the other options, you might want to skim that appendix at this&nbsp;point. If you want to begin programming quickly, you can use VS Code to start. Then you can consider other editors, once you\u2019ve gained some experience as a programmer. In this chapter, I\u2019ll walk you through installing VS Code on your operating system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h1-502703c01-0002\">Python on Different Operating Systems<\/h2>\n\n\n\n<p>Python is a cross-platform programming language, which means it runs on all the major operating systems. Any Python program you write should run on any modern computer that has Python installed. However, the methods for setting up Python on different operating systems vary slightly.<\/p>\n\n\n\n<p>In this section, you\u2019ll learn how to set up Python on your system. You\u2019ll first check whether a recent version of Python is installed on your system, and install it if it\u2019s not. Then you\u2019ll install VS Code. These are the only two steps that are different for each operating system.<\/p>\n\n\n\n<p>In the sections that follow, you\u2019ll run&nbsp;<em>hello_world.py<\/em>&nbsp;and troubleshoot anything that doesn\u2019t work. I\u2019ll walk you through this process for each operating system, so you\u2019ll have a Python programming environment that you can rely on.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h2-502703c01-0004\">Python on Windows<\/h3>\n\n\n\n<p>Windows doesn\u2019t usually come with Python, so you\u2019ll probably need to install it and then install VS Code.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-502703c01-0001\">Installing Python<\/h4>\n\n\n\n<p>First, check whether Python is installed on your system. Open a command window by entering&nbsp;<code>command<\/code>&nbsp;into the Start menu and clicking the&nbsp;<strong>Command Prompt<\/strong>&nbsp;app. In the terminal window, enter&nbsp;<code>python<\/code>&nbsp;in lowercase. If you get a Python prompt (<code>&gt;&gt;&gt;<\/code>) in response, Python is installed on your system. If you see an error message telling you that&nbsp;<code>python<\/code>&nbsp;is not a recognized command, or if the Microsoft store opens, Python isn\u2019t installed. Close the Microsoft store if it opens; it\u2019s better to download an official installer than to use Microsoft\u2019s version.<\/p>\n\n\n\n<p>If Python is not installed on your system, or if you see a version earlier than Python 3.9, you need to download a Python installer for Windows. Go to&nbsp;<a href=\"https:\/\/python.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/python.org<\/a>&nbsp;and hover over the<strong>&nbsp;Downloads&nbsp;<\/strong>link. You should see a button for downloading the latest version of Python. Click the button, which should automatically start downloading the correct installer for your system. After you\u2019ve downloaded the file, run the installer. Make sure you select the option&nbsp;<strong>Add Python to PATH<\/strong>, which will make it easier to configure your system correctly.&nbsp;<a href=\"https:\/\/learning.oreilly.com\/library\/view\/python-crash-course\/9781098156664\/c01.xhtml#figure1-1\">Figure 1-1<\/a>&nbsp;shows this option selected.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2024\/10\/f01001.png?w=640&#038;ssl=1\" alt=\"Make sure you select the checkbox labeled\u00a0Add Python to PATH. - Hello Python\"\/><figcaption class=\"wp-element-caption\">Make sure you select the checkbox labeled\u00a0<em>Add Python to PATH<\/em>.<\/figcaption><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-502703c01-0002\">Running Python in a Terminal Session<\/h4>\n\n\n\n<p>Open a new command window and enter&nbsp;<code>python<\/code>&nbsp;in lowercase. You should see a Python prompt (<code>&gt;&gt;&gt;<\/code>), which means Windows has found the version of Python you just installed.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nC:\\&gt; python\nPython 3.x.x (main, Jun . . . , 13:29:14) &#x5B;MSC v.1932 64 bit (AMD64)] on win32\nType &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.\n&gt;&gt;&gt;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Note<\/strong><\/h2>\n\n\n\n<p>If you don\u2019t see this output or something similar, see the more detailed setup instructions in&nbsp;Appendix A.<\/p>\n\n\n\n<p>Enter the following line in your Python session:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; print(&quot;Hello Python interpreter!&quot;)\nHello Python interpreter!\n&gt;&gt;&gt;\n<\/pre><\/div>\n\n\n<p>You should see the output&nbsp;<code>Hello Python interpreter!<\/code>&nbsp;Anytime you want to run a snippet of Python code, open a command window and start a Python terminal session. To close the terminal session, press CTRL-Z and then press ENTER, or enter the command&nbsp;<code>exit()<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-502703c01-0003\">Installing VS Code<\/h4>\n\n\n\n<p>You can download an installer for VS Code at&nbsp;<a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/code.visualstudio.com<\/a>. Click the&nbsp;<strong>Download for Windows<\/strong>&nbsp;button and run the installer. Skip the following sections about macOS and Linux, and follow the steps in \u201cRunning a Hello World Program\u201d on&nbsp;page 9.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h2-502703c01-0005\">Python on macOS<\/h3>\n\n\n\n<p>Python is not installed by default on the latest versions of macOS, so you\u2019ll need to install it if you haven\u2019t already done so. In this section, you\u2019ll install the latest version of Python, and then install VS Code and make sure it\u2019s configured correctly.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-502703c01-0004\">Checking Whether Python 3 Is Installed<\/h4>\n\n\n\n<p>Open a terminal window by going to&nbsp;<strong>Applications<\/strong>\u25b6<strong>Utilities<\/strong>\u25b6<strong>Terminal<\/strong>. You can also press \u2318-spacebar, type&nbsp;<code>terminal<\/code>, and then press ENTER. To see if you have a recent enough version of Python installed, enter&nbsp;<code>python3<\/code>. You\u2019ll most likely see a message about installing the&nbsp;<em>command line developer tools<\/em>. It\u2019s better to install these tools after installing Python, so if this message appears, cancel the pop-up window.<\/p>\n\n\n\n<p>If the output shows you have Python 3.9 or a later version installed, you can skip the next section and go to \u201cRunning Python in a Terminal Session.\u201d If you see any version earlier than Python 3.9, follow the instructions in the next section to install the latest version.<\/p>\n\n\n\n<p>Note that on macOS, whenever you see the&nbsp;<code>python<\/code>&nbsp;command in this book, you need to use the&nbsp;<code>python3<\/code>&nbsp;command instead to make sure you\u2019re using Python 3. On most macOS systems, the&nbsp;<code>python<\/code>&nbsp;command either points to an outdated version of Python that should only be used by internal system tools, or it points to nothing and generates an error message.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-502703c01-0005\">Installing the Latest Version of Python<\/h4>\n\n\n\n<p>You can find a Python installer for your system at&nbsp;<a href=\"https:\/\/python.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/python.org<\/a>. Hover over the&nbsp;<strong>Download<\/strong>&nbsp;link, and you should see a button for downloading the latest version of Python. Click the button, which should automatically start downloading the correct installer for your system. After the file downloads, run the installer.<\/p>\n\n\n\n<p>After the installer runs, a Finder window should appear. Double-click the&nbsp;<em>Install Certificates.command<\/em>&nbsp;file. Running this file will allow you to more easily install additional libraries that you\u2019ll need for real-world projects, including the projects in the second half of this book.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-502703c01-0006\">Running Python in a Terminal Session<\/h4>\n\n\n\n<p>You can now try running snippets of Python code by opening a new terminal window and typing&nbsp;<code>python3<\/code>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ python3\nPython 3.x.x (v3.11.0:eb0004c271, Jun . . . , 10:03:01)\n&#x5B;Clang 13.0.0 (clang-1300.0.29.30)] on darwin\nType &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.\n&gt;&gt;&gt;\n<\/pre><\/div>\n\n\n<p>This command starts a Python terminal session. You should see a Python prompt (<code>&gt;&gt;&gt;<\/code>), which means macOS has found the version of Python you just installed.<\/p>\n\n\n\n<p>Enter the following line in the terminal session:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; print(&quot;Hello Python interpreter!&quot;)\nHello Python interpreter!\n&gt;&gt;&gt;\n<\/pre><\/div>\n\n\n<p>You should see the message\u00a0<code>Hello Python interpreter!<\/code>, which should print directly in the current terminal window. You can close the Python interpreter by pressing CTRL-D or by entering the command\u00a0<code>exit()<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-502703c01-0007\">Installing VS Code<\/h4>\n\n\n\n<p>To install the VS Code editor, you need to download the installer at&nbsp;<a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/code.visualstudio.com<\/a>. Click the<strong>&nbsp;Download<\/strong>&nbsp;button, and then open a&nbsp;<strong>Finder<\/strong>&nbsp;window and go to the&nbsp;<strong>Downloads<\/strong>&nbsp;folder. Drag the&nbsp;<strong>Visual Studio Code<\/strong>&nbsp;installer to your Applications folder, then double-click the installer to run it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h2-502703c01-0006\">Python on Linux<\/h3>\n\n\n\n<p>Linux systems are designed for programming, so Python is already installed on most Linux computers. The people who write and maintain Linux expect you to do your own programming at some point, and encourage you to do so. For this reason, there\u2019s very little to install and only a few settings to change to start programming.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-502703c01-0008\">Checking Your Version of Python<\/h4>\n\n\n\n<p>Open a terminal window by running the Terminal application on your system (in Ubuntu, you can press CTRL-ALT-T). To find out which version of Python is installed, enter&nbsp;<code>python3<\/code>&nbsp;with a lowercase&nbsp;<em>p<\/em>. When Python is installed, this command starts the Python interpreter. You should see output indicating which version of Python is installed. You should also see a Python prompt (<code>&gt;&gt;&gt;<\/code>) where you can start entering Python commands:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ python3\nPython 3.10.4 (main, Apr  . . . , 09:04:19) &#x5B;GCC 11.2.0] on linux\nType &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.\n&gt;&gt;&gt;\n<\/pre><\/div>\n\n\n<p>This output indicates that Python 3.10.4 is currently the default version of Python installed on this computer. When you\u2019ve seen this output, press CTRL-D or enter&nbsp;<code>exit()<\/code>&nbsp;to leave the Python prompt and return to a&nbsp;terminal prompt. Whenever you see the&nbsp;<code>python<\/code>&nbsp;command in this book, enter&nbsp;<code>python3<\/code>&nbsp;instead.<\/p>\n\n\n\n<p>You\u2019ll need Python 3.9 or later to run the code in this book. If the Python version installed on your system is earlier than Python 3.9, or if you want to update to the latest version currently available, refer to the instructions in&nbsp;Appendix A.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-502703c01-0009\">Running Python in a Terminal Session<\/h4>\n\n\n\n<p>You can try running snippets of Python code by opening a terminal and entering&nbsp;<code>python3<\/code>, as you did when checking your version. Do this again, and when you have Python running, enter the following line in the terminal session:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; print(&quot;Hello Python interpreter!&quot;)\nHello Python interpreter!\n&gt;&gt;&gt;\n<\/pre><\/div>\n\n\n<p>The message should print directly in the current terminal window. Remember that you can close the Python interpreter by pressing CTRL-D or by entering the command&nbsp;<code>exit()<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-502703c01-0010\">Installing VS Code<\/h4>\n\n\n\n<p>On Ubuntu Linux, you can install VS Code from the Ubuntu Software Center. Click the Ubuntu Software icon in your menu and search for&nbsp;<em>vscode<\/em>. Click the app called&nbsp;<strong>Visual Studio Code<\/strong>&nbsp;(sometimes called&nbsp;<em>code<\/em>), and then click&nbsp;<strong>Install<\/strong>. Once it\u2019s installed, search your system for&nbsp;<em>VS Code<\/em>&nbsp;and launch the app.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h1-502703c01-0003\">Running a Hello World Program<\/h2>\n\n\n\n<p>With a recent version of Python and VS Code installed, you\u2019re almost ready to run your first Python program written in a text editor. But before doing so, you need to install the Python extension for VS Code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h2-502703c01-0007\">Installing the Python Extension for VS Code<\/h3>\n\n\n\n<p>VS Code works with many different programming languages; to get the most out of it as a Python programmer, you\u2019ll need to install the Python extension. This extension adds support for writing, editing, and running Python programs.<\/p>\n\n\n\n<p>To install the Python extension, click the Manage icon, which looks like a gear in the lower-left corner of the VS Code app. In the menu that appears, click\u00a0<strong>Extensions<\/strong>. Enter\u00a0<code>python<\/code>\u00a0in the search box and click the\u00a0<strong>Python\u00a0<\/strong>extension. (If you see more than one extension named\u00a0<em>Python<\/em>, choose the one supplied by Microsoft.) Click\u00a0<strong>Install<\/strong>\u00a0and install any additional tools that your system needs to complete the installation. If you see a message that you need to install Python, and you\u2019ve already done so, you can ignore this message.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>If you\u2019re using macOS and a pop-up asks you to install the&nbsp;<em>command line developer tools<\/em>, click&nbsp;<strong>Install<\/strong>. You may see a message that it will take an excessively long time to install, but it should only take about 10 or 20 minutes on a reasonable internet connection.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h2-502703c01-0008\">Running hello_world.py<\/h3>\n\n\n\n<p>Before you write your first program, make a folder called&nbsp;<em>python_work&nbsp;<\/em>on your desktop for your projects. It\u2019s best to use lowercase letters and underscores for spaces in file and folder names, because Python uses these naming conventions. You can make this folder somewhere other than the desktop, but it will be easier to follow some later steps if you save the&nbsp;<em>python_work<\/em>&nbsp;folder directly on your desktop.<\/p>\n\n\n\n<p>Open VS Code, and close the&nbsp;<strong>Get Started<\/strong>&nbsp;tab if it\u2019s still open. Make a new file by clicking&nbsp;<strong>File<\/strong>\u25b6<strong>New File<\/strong>&nbsp;or pressing CTRL-N (\u2318-N on macOS). Save the file as&nbsp;<em>hello_world.py<\/em>&nbsp;in your&nbsp;<em>python_work<\/em>&nbsp;folder. The extension&nbsp;<em>.py<\/em>&nbsp;tells VS Code that your file is written in Python, and tells it how to run the program and highlight the text in a helpful way.<\/p>\n\n\n\n<p>After you\u2019ve saved your file, enter the following line in the editor:<\/p>\n\n\n\n<p><strong>hello_world.py<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nprint(&quot;Hello Python world!&quot;)\n<\/pre><\/div>\n\n\n<p>To run your program, select&nbsp;<strong>Run<\/strong>\u25b6<strong>Run Without Debugging<\/strong>&nbsp;or press CTRL-F5. A terminal screen should appear at the bottom of the VS Code window, showing your program\u2019s output:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nHello Python world!\n<\/pre><\/div>\n\n\n<p>You\u2019ll likely see some additional output showing the Python interpreter that was used to run your program. If you want to simplify the information that\u2019s displayed so you only see your program\u2019s output, see&nbsp;Appendix B. You can also find helpful suggestions about how to use VS Code more efficiently in&nbsp;Appendix B.<\/p>\n\n\n\n<p>If you don\u2019t see this output, something might have gone wrong in the program. Check every character on the line you entered. Did you accidentally capitalize&nbsp;<code>print<\/code>? Did you forget one or both of the quotation marks or parentheses? Programming languages expect very specific syntax, and if you don\u2019t provide that, you\u2019ll get errors. If you can\u2019t get the program to run, see the suggestions in the next section.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h1-502703c01-0004\">Troubleshooting<\/h2>\n\n\n\n<p>If you can\u2019t get&nbsp;<em>hello_world.py<\/em>&nbsp;to run, here are a few remedies you can try that are also good general solutions for any programming problem:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When a program contains a significant error, Python displays a\u00a0<em>traceback<\/em>, which is an error report. Python looks through the file and tries to identify the problem. Check the traceback; it might give you a clue as to what issue is preventing the program from running.<\/li>\n\n\n\n<li>Step away from your computer, take a short break, and then try again. Remember that syntax is very important in programming, so something as simple as mismatched quotation marks or mismatched parentheses can prevent a program from running properly. Reread the relevant parts of this chapter, look over your code, and try to find the mistake.<\/li>\n\n\n\n<li>Start over again. You probably don\u2019t need to uninstall any software, but it might make sense to delete your\u00a0<em>hello_world.py<\/em>\u00a0file and re-create it from scratch.<\/li>\n\n\n\n<li>Ask someone else to follow the steps in this chapter, on your computer or a different one, and watch what they do carefully. You might have missed one small step that someone else happens to catch.<\/li>\n\n\n\n<li>See the additional installation instructions in\u00a0Appendix A; some of the details included in the Appendix may help you solve your issue.<\/li>\n\n\n\n<li>Find someone who knows Python and ask them to help you get set up. If you ask around, you might find that you unexpectedly know someone who uses Python.<\/li>\n\n\n\n<li>The setup instructions in this chapter are also available through this book\u2019s companion website at\u00a0<a href=\"https:\/\/ehmatthes.github.io\/pcc_3e\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/ehmatthes.github.io\/pcc_3e<\/a>. The online version of these instructions might work better because you can simply cut and paste code and click links to the resources you need.<\/li>\n\n\n\n<li>Ask for help online.\u00a0Appendix C\u00a0provides a number of resources, such as forums and live chat sites, where you can ask for solutions from people who\u2019ve already worked through the issue you\u2019re currently facing.<\/li>\n<\/ul>\n\n\n\n<p>Never worry that you\u2019re bothering experienced programmers. Every programmer has been stuck at some point, and most programmers are happy to help you set up your system correctly. As long as you can state clearly what you\u2019re trying to do, what you\u2019ve already tried, and the results you\u2019re getting, there\u2019s a good chance someone will be able to help you. As mentioned in the&nbsp;introduction, the Python community is very friendly and welcoming to beginners.<\/p>\n\n\n\n<p>Python should run well on any modern computer. Early setup issues can be frustrating, but they\u2019re well worth sorting out. Once you get&nbsp;<em>hello_world.py&nbsp;<\/em>running, you can start to learn Python, and your programming work will become more interesting and satisfying.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h1-502703c01-0005\">Running Python Programs from a Terminal<\/h2>\n\n\n\n<p>You\u2019ll run most of your programs directly in your text editor. However, sometimes it\u2019s useful to run programs from a terminal instead. For example, you might want to run an existing program without opening it for editing.<\/p>\n\n\n\n<p>You can do this on any system with Python installed if you know how to access the directory where the program file is stored. To try this, make sure you\u2019ve saved the&nbsp;<em>hello_world.py<\/em>&nbsp;file in the&nbsp;<em>python_work<\/em>&nbsp;folder on your desktop.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h2-502703c01-0009\">On Windows<\/h3>\n\n\n\n<p>You can use the terminal command&nbsp;<code>cd<\/code>, for&nbsp;<em>change directory<\/em>, to navigate through your filesystem in a command window. The command&nbsp;<code>dir<\/code>, for&nbsp;<em>directory<\/em>, shows you all the files that exist in the current directory.<\/p>\n\n\n\n<p>Open a new terminal window and enter the following commands to run&nbsp;<em>hello_world.py<\/em>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nC:\\&gt; cd Desktop\\python_work\nC:\\Desktop\\python_work&gt; dir\nhello_world.py\nC:\\Desktop\\python_work&gt; python hello_world.py\nHello Python world!\n<\/pre><\/div>\n\n\n<p>First, use the&nbsp;<code>cd<\/code>&nbsp;command to navigate to the&nbsp;<em>python_work<\/em>&nbsp;folder, which is in the<em>&nbsp;Desktop<\/em>&nbsp;folder. Next, use the&nbsp;<code>dir<\/code>&nbsp;command to make sure&nbsp;<em>hello_world.py<\/em>&nbsp;is in this folder. Then run the file using the command&nbsp;<code>python hello_world.py<\/code>.<\/p>\n\n\n\n<p>Most of your programs will run fine directly from your editor. However, as your work becomes more complex, you\u2019ll want to run some of your programs from a terminal.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h2-502703c01-0010\">On macOS and Linux<\/h3>\n\n\n\n<p>Running a Python program from a terminal session is the same on Linux and macOS. You can use the terminal command&nbsp;<code>cd<\/code>, for&nbsp;<em>change directory<\/em>, to navigate through your filesystem in a terminal session. The command&nbsp;<code>ls<\/code>, for&nbsp;<em>list<\/em>, shows you all the nonhidden files that exist in the current directory.<\/p>\n\n\n\n<p>Open a new terminal window and enter the following commands to run&nbsp;<em>hello_world.py<\/em>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n~$ cd Desktop\/python_work\/\n~\/Desktop\/python_work$ ls\nhello_world.py\n~\/Desktop\/python_work$ python3 hello_world.py\nHello Python world!\n<\/pre><\/div>\n\n\n<p>First, use the&nbsp;<code>cd<\/code>&nbsp;command to navigate to the&nbsp;<em>python_work<\/em>&nbsp;folder, which is in the&nbsp;<em>Desktop<\/em>&nbsp;folder. Next, use the&nbsp;<code>ls<\/code>&nbsp;command to make sure&nbsp;<em>hello_world.py<\/em>&nbsp;is in this folder. Then run the file using the command&nbsp;<code>python3 hello_world.py<\/code>.<\/p>\n\n\n\n<p>Most of your programs will run fine directly from your editor. But as your work becomes more complex, you\u2019ll want to run some of your programs from a terminal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello Python! is a new thread in my blog. I started to learn this programming language a few months ago but now I have to be serious.<\/p>\n","protected":false},"author":31447,"featured_media":1400,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_has_post_settings":[],"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Hello #Python! is a new thread in my blog. I started to learn this programming language a few months ago but now I have to be serious.","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[9864],"tags":[9294],"hashtags":[9865],"class_list":["post-64621","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python","hashtags-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Hello Python - PureSourceCode<\/title>\n<meta name=\"description\" content=\"Hello Python! is a new thread in my blog. I started to learn this programming language a few months ago but now I have to be serious.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hello Python - PureSourceCode\" \/>\n<meta property=\"og:description\" content=\"Hello Python! is a new thread in my blog. I started to learn this programming language a few months ago but now I have to be serious.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/\" \/>\n<meta property=\"og:site_name\" content=\"PureSourceCode\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/puresourcecode\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-12T16:42:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-12T16:42:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1395\" \/>\n\t<meta property=\"og:image:height\" content=\"864\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Enrico Rossini\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@puresourcecode\" \/>\n<meta name=\"twitter:site\" content=\"@puresourcecode\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Enrico Rossini\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/\"},\"author\":{\"name\":\"Enrico Rossini\",\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/#\\\/schema\\\/person\\\/a52f2594271f688efd76e2a2c3434362\"},\"headline\":\"Hello Python\",\"datePublished\":\"2024-10-12T16:42:36+00:00\",\"dateModified\":\"2024-10-12T16:42:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/\"},\"wordCount\":3379,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/puresourcecode.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/Python-programming.jpg?fit=1395%2C864&ssl=1\",\"keywords\":[\"python\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/\",\"url\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/\",\"name\":\"Hello Python - PureSourceCode\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/puresourcecode.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/Python-programming.jpg?fit=1395%2C864&ssl=1\",\"datePublished\":\"2024-10-12T16:42:36+00:00\",\"dateModified\":\"2024-10-12T16:42:40+00:00\",\"description\":\"Hello Python! is a new thread in my blog. I started to learn this programming language a few months ago but now I have to be serious.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/puresourcecode.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/Python-programming.jpg?fit=1395%2C864&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/puresourcecode.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/Python-programming.jpg?fit=1395%2C864&ssl=1\",\"width\":1395,\"height\":864,\"caption\":\"Python programming language\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/programming-languages\\\/python\\\/hello-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/puresourcecode.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hello Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/#website\",\"url\":\"https:\\\/\\\/puresourcecode.com\\\/\",\"name\":\"PureSourceCode.com\",\"description\":\"All technologies, only pure source code\",\"publisher\":{\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/puresourcecode.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/#organization\",\"name\":\"PureSourceCode\",\"url\":\"https:\\\/\\\/puresourcecode.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/puresourcecode.com\\\/wp-content\\\/uploads\\\/job-manager-uploads\\\/company_logo\\\/2021\\\/05\\\/psc_logo.png?fit=512%2C512&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/puresourcecode.com\\\/wp-content\\\/uploads\\\/job-manager-uploads\\\/company_logo\\\/2021\\\/05\\\/psc_logo.png?fit=512%2C512&ssl=1\",\"width\":512,\"height\":512,\"caption\":\"PureSourceCode\"},\"image\":{\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/puresourcecode\",\"https:\\\/\\\/x.com\\\/puresourcecode\",\"https:\\\/\\\/www.youtube.com\\\/erossini?sub_confirmation=1\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/puresourcecode.com\\\/#\\\/schema\\\/person\\\/a52f2594271f688efd76e2a2c3434362\",\"name\":\"Enrico Rossini\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7b46e0c2b161e4126705d4496b5a86dc8771e8014a7eff00cf437b60dc3abd85?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7b46e0c2b161e4126705d4496b5a86dc8771e8014a7eff00cf437b60dc3abd85?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7b46e0c2b161e4126705d4496b5a86dc8771e8014a7eff00cf437b60dc3abd85?s=96&d=mm&r=g\",\"caption\":\"Enrico Rossini\"},\"sameAs\":[\"https:\\\/\\\/puresourcecode.com\"],\"url\":\"https:\\\/\\\/puresourcecode.com\\\/author\\\/erossi03\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hello Python - PureSourceCode","description":"Hello Python! is a new thread in my blog. I started to learn this programming language a few months ago but now I have to be serious.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/","og_locale":"en_US","og_type":"article","og_title":"Hello Python - PureSourceCode","og_description":"Hello Python! is a new thread in my blog. I started to learn this programming language a few months ago but now I have to be serious.","og_url":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/","og_site_name":"PureSourceCode","article_publisher":"https:\/\/www.facebook.com\/puresourcecode","article_published_time":"2024-10-12T16:42:36+00:00","article_modified_time":"2024-10-12T16:42:40+00:00","og_image":[{"width":1395,"height":864,"url":"https:\/\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg","type":"image\/jpeg"}],"author":"Enrico Rossini","twitter_card":"summary_large_image","twitter_creator":"@puresourcecode","twitter_site":"@puresourcecode","twitter_misc":{"Written by":"Enrico Rossini","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/#article","isPartOf":{"@id":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/"},"author":{"name":"Enrico Rossini","@id":"https:\/\/puresourcecode.com\/#\/schema\/person\/a52f2594271f688efd76e2a2c3434362"},"headline":"Hello Python","datePublished":"2024-10-12T16:42:36+00:00","dateModified":"2024-10-12T16:42:40+00:00","mainEntityOfPage":{"@id":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/"},"wordCount":3379,"commentCount":0,"publisher":{"@id":"https:\/\/puresourcecode.com\/#organization"},"image":{"@id":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg?fit=1395%2C864&ssl=1","keywords":["python"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/","url":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/","name":"Hello Python - PureSourceCode","isPartOf":{"@id":"https:\/\/puresourcecode.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/#primaryimage"},"image":{"@id":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg?fit=1395%2C864&ssl=1","datePublished":"2024-10-12T16:42:36+00:00","dateModified":"2024-10-12T16:42:40+00:00","description":"Hello Python! is a new thread in my blog. I started to learn this programming language a few months ago but now I have to be serious.","breadcrumb":{"@id":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/#primaryimage","url":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg?fit=1395%2C864&ssl=1","contentUrl":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg?fit=1395%2C864&ssl=1","width":1395,"height":864,"caption":"Python programming language"},{"@type":"BreadcrumbList","@id":"https:\/\/puresourcecode.com\/programming-languages\/python\/hello-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/puresourcecode.com\/"},{"@type":"ListItem","position":2,"name":"Hello Python"}]},{"@type":"WebSite","@id":"https:\/\/puresourcecode.com\/#website","url":"https:\/\/puresourcecode.com\/","name":"PureSourceCode.com","description":"All technologies, only pure source code","publisher":{"@id":"https:\/\/puresourcecode.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/puresourcecode.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/puresourcecode.com\/#organization","name":"PureSourceCode","url":"https:\/\/puresourcecode.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/puresourcecode.com\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/job-manager-uploads\/company_logo\/2021\/05\/psc_logo.png?fit=512%2C512&ssl=1","contentUrl":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/job-manager-uploads\/company_logo\/2021\/05\/psc_logo.png?fit=512%2C512&ssl=1","width":512,"height":512,"caption":"PureSourceCode"},"image":{"@id":"https:\/\/puresourcecode.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/puresourcecode","https:\/\/x.com\/puresourcecode","https:\/\/www.youtube.com\/erossini?sub_confirmation=1"]},{"@type":"Person","@id":"https:\/\/puresourcecode.com\/#\/schema\/person\/a52f2594271f688efd76e2a2c3434362","name":"Enrico Rossini","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7b46e0c2b161e4126705d4496b5a86dc8771e8014a7eff00cf437b60dc3abd85?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7b46e0c2b161e4126705d4496b5a86dc8771e8014a7eff00cf437b60dc3abd85?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7b46e0c2b161e4126705d4496b5a86dc8771e8014a7eff00cf437b60dc3abd85?s=96&d=mm&r=g","caption":"Enrico Rossini"},"sameAs":["https:\/\/puresourcecode.com"],"url":"https:\/\/puresourcecode.com\/author\/erossi03\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg?fit=1395%2C864&ssl=1","jetpack-related-posts":[{"id":43822,"url":"https:\/\/puresourcecode.com\/programming-languages\/python\/getting-started-with-python\/","url_meta":{"origin":64621,"position":0},"title":"Getting started with Python","author":"Enrico","date":"March 6, 2023","format":false,"excerpt":"Python is a high-level, general-purpose and a very popular programming language that lets you work quickly and integrate systems effectively","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/puresourcecode.com\/category\/programming-languages\/python\/"},"img":{"alt_text":"Python programming language - logo","src":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":64667,"url":"https:\/\/puresourcecode.com\/programming-languages\/python\/variables-and-simple-data-types-in-python\/","url_meta":{"origin":64621,"position":1},"title":"Variables and simple data types in Python","author":"Enrico Rossini","date":"October 14, 2024","format":false,"excerpt":"Continue the series of posts about Python: this new post is about variables and simple data types and constants.","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/puresourcecode.com\/category\/programming-languages\/python\/"},"img":{"alt_text":"Python programming language - logo","src":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1399,"url":"https:\/\/puresourcecode.com\/news\/microsoft\/microsoft-new-free-python-programming-language-courses-are-for-novice-ai-developers\/","url_meta":{"origin":64621,"position":2},"title":"Microsoft: new free Python programming language courses are for novice AI developers","author":"Enrico","date":"May 5, 2020","format":false,"excerpt":"Aspiring data-science and machine-learning developers now have more Microsoft-made free video tutorials to learn how to build software in Python, one of today's most popular and versatile programming languages.\u00a0 The new\u00a0More Python for Beginners\u00a0series consists of 20 videos that run between two minutes and 15 minutes each. It covers working\u2026","rel":"","context":"In &quot;Microsoft&quot;","block_context":{"text":"Microsoft","link":"https:\/\/puresourcecode.com\/category\/news\/microsoft\/"},"img":{"alt_text":"Python programming language","src":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg?fit=1200%2C743&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg?fit=1200%2C743&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg?fit=1200%2C743&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg?fit=1200%2C743&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2020\/05\/Python-programming.jpg?fit=1200%2C743&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":43898,"url":"https:\/\/puresourcecode.com\/programming-languages\/python\/bitmap-message-in-python\/","url_meta":{"origin":64621,"position":3},"title":"Bitmap message in Python","author":"Enrico","date":"March 8, 2023","format":false,"excerpt":"I continue to explore with a new example where I create a bitmap message in Python. Based on an string image, I change it with the user input","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/puresourcecode.com\/category\/programming-languages\/python\/"},"img":{"alt_text":"Python programming language - logo","src":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":43893,"url":"https:\/\/puresourcecode.com\/programming-languages\/python\/bagels-a-logic-game-in-python\/","url_meta":{"origin":64621,"position":4},"title":"Bagels a logic game in Python","author":"Enrico","date":"March 7, 2023","format":false,"excerpt":"In Bagels, a deductive logic game in Python, you must guess a secret three-digit number based on clues.This is the first of a list of examples","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/puresourcecode.com\/category\/programming-languages\/python\/"},"img":{"alt_text":"Python programming language - logo","src":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2023\/03\/python.jpg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":29279,"url":"https:\/\/puresourcecode.com\/news\/employers-are-desperate-for-data-scientists\/","url_meta":{"origin":64621,"position":5},"title":"Employers are desperate for data scientists","author":"Enrico","date":"January 31, 2022","format":false,"excerpt":"The demand for data science is growing fast and employers are desperate for data scientists. On top of that, the great resignations is on. What do you think about it? What is your experience?","rel":"","context":"In &quot;News&quot;","block_context":{"text":"News","link":"https:\/\/puresourcecode.com\/category\/news\/"},"img":{"alt_text":"data scientist","src":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2022\/01\/data-scientist.png?fit=1000%2C560&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2022\/01\/data-scientist.png?fit=1000%2C560&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2022\/01\/data-scientist.png?fit=1000%2C560&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/puresourcecode.com\/wp-content\/uploads\/2022\/01\/data-scientist.png?fit=1000%2C560&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_shortlink":"https:\/\/wp.me\/pbPHZq-gOh","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/posts\/64621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/users\/31447"}],"replies":[{"embeddable":true,"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/comments?post=64621"}],"version-history":[{"count":1,"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/posts\/64621\/revisions"}],"predecessor-version":[{"id":64623,"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/posts\/64621\/revisions\/64623"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/media\/1400"}],"wp:attachment":[{"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/media?parent=64621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/categories?post=64621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/tags?post=64621"},{"taxonomy":"hashtags","embeddable":true,"href":"https:\/\/puresourcecode.com\/wp-json\/wp\/v2\/hashtags?post=64621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}