<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>Real Python</title>
  <link href="https://realpython.com/atom.xml" rel="self"/>
  <link href="https://realpython.com/"/>
  <updated>2021-04-23T12:00:00+00:00</updated>
  <id>https://realpython.com/</id>
  <author>
    <name>Real Python</name>
  </author>

  
    <entry>
      <title>The Real Python Podcast – Episode #57: Taking the Next Step in Python Game Development</title>
      <id>https://realpython.com/podcasts/rpp/57/</id>
      <link href="https://realpython.com/podcasts/rpp/57/"/>
      <updated>2021-04-23T12:00:00+00:00</updated>
      <summary>Are you interested in creating video games but feel limited in what you can accomplish within Python? Is there a platform where you can take advantage of your Python skills and provide the benefits of a dedicated game engine? This week on the show, we have Paweł Fertyk. Paweł is a Real Python author and has been creating games as Miskatonic Studio for several years now.</summary>
      <content type="html">
        &lt;p&gt;Are you interested in creating video games but feel limited in what you can accomplish within Python? Is there a platform where you can take advantage of your Python skills and provide the benefits of a dedicated game engine? This week on the show, we have Paweł Fertyk. Paweł is a Real Python author and has been creating games as Miskatonic Studio for several years now.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Community Interview With Moshe Zadka</title>
      <id>https://realpython.com/interview-moshe-zadka/</id>
      <link href="https://realpython.com/interview-moshe-zadka/"/>
      <updated>2021-04-21T14:00:00+00:00</updated>
      <summary>This week, we&#x27;re joined by Moshe Zadka, a senior site reliability engineer at SurveyMonkey. Moshe is a core developer for the Twisted framework, and we discuss Python for DevOps, writing Python books, and tai chi.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;This week, I’m joined by &lt;a href=&quot;https://twitter.com/moshezadka/&quot;&gt;Moshe Zadka&lt;/a&gt;, a senior site reliability engineer at SurveyMonkey. Moshe is a core developer for the &lt;a href=&quot;https://pypi.org/project/Twisted/&quot;&gt;Twisted framework&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/team/mzadka/&quot;&gt;a &lt;em&gt;Real Python&lt;/em&gt; author&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;In this interview, we discuss a variety of topics, including the Twisted framework, Python for DevOps, writing Python books, and tai chi.&lt;/p&gt;
&lt;p class=&quot;mt-5&quot;&gt;&lt;strong&gt;Ricky:&lt;/strong&gt; &lt;em&gt;Thanks for joining me, Moshe. I’d like to start with the same questions I do with all my interview guests: how did you get into programming, and when did you start using Python?&lt;/em&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid w-25 float-right ml-3 rounded-circle&quot; src=&quot;https://files.realpython.com/media/headshot2.323dd777a518.jpg&quot; width=&quot;413&quot; height=&quot;413&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/headshot2.323dd777a518.jpg&amp;amp;w=103&amp;amp;sig=9d51bfec91ccef8c7d8ce167fa96bb538f6160da 103w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/headshot2.323dd777a518.jpg&amp;amp;w=206&amp;amp;sig=2c61cfd3af042661782e5ffc136a5643bf3c3434 206w, https://files.realpython.com/media/headshot2.323dd777a518.jpg 413w&quot; sizes=&quot;75vw&quot; alt=&quot;Moshe Zadka&quot; data-asset=&quot;2537&quot;&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Moshe:&lt;/strong&gt; The first programming project I remember working on was a project for class, converting numbers from decimal to binary in Basic. The teacher thought this was a little advanced for a seven-year-old, which was my main motivation for finishing it. &lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/interview-moshe-zadka/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/interview-moshe-zadka/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learn Text Classification With Python and Keras</title>
      <id>https://realpython.com/courses/text-classification-with-keras/</id>
      <link href="https://realpython.com/courses/text-classification-with-keras/"/>
      <updated>2021-04-20T14:00:00+00:00</updated>
      <summary>Learn about Python text classification with Keras. Work your way from a bag-of-words model with logistic regression to more advanced methods leading to convolutional neural networks. See why word embeddings are useful and how you can use pretrained word embeddings. Use hyperparameter optimization to squeeze more performance out of your model.</summary>
      <content type="html">
        &lt;p&gt;Imagine you could know the mood of the people on the Internet. Maybe you are not interested in its entirety, but only if people are today happy on your favorite social media platform. After this course, you&amp;rsquo;ll be equipped to do this. While doing this, you will get a grasp of current advancements of (deep) neural networks and how they can be applied to text.&lt;/p&gt;
&lt;p&gt;Reading the mood from text with machine learning is called &lt;a href=&quot;https://realpython.com/sentiment-analysis-python/&quot;&gt;sentiment analysis&lt;/a&gt;, and it is one of the prominent use cases in text classification. This falls into the very active research field of &lt;a href=&quot;https://en.wikipedia.org/wiki/Natural_language_processing&quot;&gt;natural language processing (NLP)&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Deploying a Python Flask Example Application Using Heroku</title>
      <id>https://realpython.com/flask-by-example-part-1-project-setup/</id>
      <link href="https://realpython.com/flask-by-example-part-1-project-setup/"/>
      <updated>2021-04-19T15:02:15+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn how to create a Python Flask example web application and deploy it using Heroku.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In this tutorial, you’ll create a Python &lt;a href=&quot;https://flask.palletsprojects.com/&quot;&gt;Flask&lt;/a&gt; example application and deploy it using &lt;a href=&quot;https://heroku.com&quot;&gt;Heroku&lt;/a&gt;, making it publicly available on the web. Heroku removes much of the infrastructure burden related to building and running &lt;a href=&quot;https://realpython.com/python-web-applications/&quot;&gt;web applications&lt;/a&gt;, allowing you to focus on creating an awesome app.&lt;/p&gt;
&lt;p&gt;Besides deploying the app, you’ll use Git to track changes to the code, and you’ll also configure a deployment workflow with different environments for staging and production. Using this setup, you’ll be able to test and preview the app before releasing it. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a Python &lt;strong&gt;Flask example web application&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deploy&lt;/strong&gt; the web application using Heroku&lt;/li&gt;
&lt;li&gt;Implement a deployment &lt;strong&gt;workflow&lt;/strong&gt; using Heroku &lt;strong&gt;pipelines&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Manage &lt;strong&gt;configuration&lt;/strong&gt; and &lt;strong&gt;secrets&lt;/strong&gt; for different environments in a secure way&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This tutorial assumes that you understand the basics of how web applications work and that you have some experience using Git. To get up to speed on these topics, check out &lt;a href=&quot;https://realpython.com/python-web-applications-with-flask-part-i/&quot;&gt;Python Web Applications with Flask (Tutorial Series)&lt;/a&gt; and  &lt;a href=&quot;https://realpython.com/python-git-github-intro/&quot;&gt;Introduction to Git and GitHub for Python Developers&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As you’ll learn through this tutorial, by combining Flask and Heroku, you can minimize the effort required to create and run web applications. You can click the link below to get the full source code for this tutorial’s application:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Sample Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-flask-example-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-flask-example-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the source code&lt;/a&gt; you’ll use to build a Python Flask example application in this turorial.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;creating-the-python-flask-example-application&quot;&gt;Creating the Python Flask Example Application&lt;a class=&quot;headerlink&quot; href=&quot;#creating-the-python-flask-example-application&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this section, you’ll learn how to create a Python Flask example application and run it locally. You’re going to initialize the project, install Flask, create the application, and run it on your computer. You’ll also learn how to use Git to version your application’s code.&lt;/p&gt;
&lt;h3 id=&quot;initializing-the-project&quot;&gt;Initializing the Project&lt;a class=&quot;headerlink&quot; href=&quot;#initializing-the-project&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The project initialization consists of creating a directory for your application, setting up a &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;Python virtual environment&lt;/a&gt; where dependencies will be installed, and initializing the &lt;strong&gt;Git repository&lt;/strong&gt;. You don’t have to use a virtual environment or Git for local development, but they are very convenient and will make development and deployment to Heroku simpler.&lt;/p&gt;
&lt;p&gt;Start by creating a new directory for the Python Flask example app. You can do it by running these commands:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;mkdir realpython-example-app
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; realpython-example-app
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The above commands create a &lt;code&gt;realpython-example-app/&lt;/code&gt; folder and change the current working directory to it.&lt;/p&gt;
&lt;p&gt;Next, you must create a Python virtual environment. Using a virtual environment allows you to manage your project’s dependencies without messing with system-level files shared by all applications. Run the following commands to create and activate a virtual environment for your application. Remember to change the directory to &lt;code&gt;realpython-example-app/&lt;/code&gt; if you haven’t already:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python3 -m venv venv
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;These commands create a virtual environment named &lt;code&gt;venv&lt;/code&gt; and activate it, so packages will be loaded and installed from this environment instead of using the system-level packages.&lt;/p&gt;
&lt;h3 id=&quot;installing-dependencies&quot;&gt;Installing Dependencies&lt;a class=&quot;headerlink&quot; href=&quot;#installing-dependencies&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The first step is to install the Flask Python package. You can run the following command to install Flask using &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python3 -m pip install &lt;span class=&quot;nv&quot;&gt;Flask&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;.1.2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The above command installs Flask version &lt;code&gt;1.1.2&lt;/code&gt;. This is the version you’ll use throughout this tutorial. Next, you need to create a &lt;code&gt;requirements.txt&lt;/code&gt; file listing the project’s dependencies. You can use the &lt;code&gt;python3 -m pip freeze&lt;/code&gt; command for this task:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python3 -m pip freeze &amp;gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You’ll use &lt;code&gt;requirements.txt&lt;/code&gt; when deploying the project to tell Heroku which packages must be installed to run your application code. To learn more about how to install Flask in a virtual environment and other &lt;code&gt;pip&lt;/code&gt; options, check out the &lt;a href=&quot;https://flask.palletsprojects.com/en/1.1.x/installation/&quot;&gt;Flask installation documentation&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;What Is Pip? A Guide for New Pythonistas&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Now, the application directory should look like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;realpython-example-app/
│
├── venv/
│
└── requirements.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/flask-by-example-part-1-project-setup/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/flask-by-example-part-1-project-setup/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #56: OrderedDict vs dict and Object Oriented Programming in Python vs Java</title>
      <id>https://realpython.com/podcasts/rpp/56/</id>
      <link href="https://realpython.com/podcasts/rpp/56/"/>
      <updated>2021-04-16T12:00:00+00:00</updated>
      <summary>Are you looking for a bit of order when working with dictionaries in Python? Are you aware that the Python dict has changed over the last several versions and now keeps items in order? Could you learn more about object-oriented programming in Python by comparing it to another language? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Are you looking for a bit of order when working with dictionaries in Python? Are you aware that the Python dict has changed over the last several versions and now keeps items in order? Could you learn more about object-oriented programming in Python by comparing it to another language? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Build a Python Directory Tree Generator for the Command Line</title>
      <id>https://realpython.com/directory-tree-generator-python/</id>
      <link href="https://realpython.com/directory-tree-generator-python/"/>
      <updated>2021-04-14T14:00:00+00:00</updated>
      <summary>In this step-by-step project, you&#x27;ll create a Python directory tree generator application for your command line. You&#x27;ll code the command-line interface with argparse and traverse the file system using pathlib.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Creating applications with a user-friendly &lt;a href=&quot;https://en.wikipedia.org/wiki/Command-line_interface&quot;&gt;command-line interface (CLI)&lt;/a&gt; is a useful skill for a Python developer. With this skill, you can create tools to automate and speed up tasks in your working environment. In this tutorial, you’ll build a Python directory tree generator tool for your command line.&lt;/p&gt;
&lt;p&gt;The application will take a directory path as an argument at the command line and display a directory tree diagram on your screen. It’ll also provide other options to tweak the output.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a &lt;strong&gt;CLI application&lt;/strong&gt; with Python’s &lt;code&gt;argparse&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Recursively &lt;strong&gt;traverse a directory structure&lt;/strong&gt; using &lt;code&gt;pathlib&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Generate, format, and display a &lt;strong&gt;directory tree diagram&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Save the directory tree diagram to an &lt;strong&gt;output file&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can download the code and other resources required to build this directory tree generator project by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Sample Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/directory-tree-generator-python/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-directory-tree-generator-python&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get the sample code you’ll use&lt;/a&gt; to build a directory tree generator with Python in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;demo-a-directory-tree-generator-tool-in-python&quot;&gt;Demo: A Directory Tree Generator Tool in Python&lt;a class=&quot;headerlink&quot; href=&quot;#demo-a-directory-tree-generator-tool-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this tutorial, you’ll build a command-line tool to list the contents of a &lt;a href=&quot;https://en.wikipedia.org/wiki/Directory_(computing)&quot;&gt;directory&lt;/a&gt; or folder in a &lt;a href=&quot;https://en.wikipedia.org/wiki/Tree_structure&quot;&gt;treelike diagram&lt;/a&gt;. There are already several mature solutions out there that perform this task. You’ll find tools like the &lt;a href=&quot;https://en.wikipedia.org/wiki/Tree_(command)&quot;&gt;&lt;code&gt;tree&lt;/code&gt;&lt;/a&gt; command, which is available on most operating systems, plus other tools, like &lt;a href=&quot;https://treelib.readthedocs.io/&quot;&gt;treelib&lt;/a&gt;, &lt;a href=&quot;https://github.com/mauriziodimatteo/dirtreex&quot;&gt;dirtriex&lt;/a&gt;, and so on. However, figuring out your own solution to this problem would be a good learning exercise.&lt;/p&gt;
&lt;p&gt;This tutorial refers to the kind of tool described above as a &lt;strong&gt;directory tree generator&lt;/strong&gt;. The tool you’ll build here will allow you to generate and display a treelike diagram listing the internal &lt;a href=&quot;https://en.wikipedia.org/wiki/Directory_structure&quot;&gt;structure&lt;/a&gt; of a given directory in your &lt;a href=&quot;https://en.wikipedia.org/wiki/File_system&quot;&gt;file system&lt;/a&gt;. You’ll also find this diagram referred to as a &lt;strong&gt;directory tree diagram&lt;/strong&gt; throughout the tutorial.&lt;/p&gt;
&lt;p&gt;Your directory tree generator will have a user-friendly CLI. It’ll also provide some interesting features, such as displaying a tree diagram with the contents of a directory on your terminal window and saving the diagram to an external file.&lt;/p&gt;
&lt;p&gt;Here’s how the application will look and work once you get to the end of this tutorial:&lt;/p&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/directory-tree-generator-demo.338645b87928.gif&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/directory-tree-generator-demo.338645b87928.gif&quot; width=&quot;1000&quot; height=&quot;562&quot; srcset=&quot;https://files.realpython.com/media/directory-tree-generator-demo.338645b87928.gif 250w, https://files.realpython.com/media/directory-tree-generator-demo.338645b87928.gif 500w, https://files.realpython.com/media/directory-tree-generator-demo.338645b87928.gif 1000w&quot; sizes=&quot;75vw&quot; alt=&quot;Directory Tree Generator Demo&quot; data-asset=&quot;3507&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Your directory tree generator will provide a fully functional but minimal CLI with a couple of options that allow you to generate and display a tree diagram listing all the files and directories in a given root directory.&lt;/p&gt;
&lt;h2 id=&quot;project-overview&quot;&gt;Project Overview&lt;a class=&quot;headerlink&quot; href=&quot;#project-overview&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The project you’ll build in this tutorial consists of a command-line application that takes a directory path as an argument, walks through its internal structure, and generates a treelike diagram listing the contents of the directory at hand. In this section, you’ll take a first look at the problem and a possible solution. You’ll also decide how to lay out the project.&lt;/p&gt;
&lt;h3 id=&quot;laying-out-the-project&quot;&gt;Laying Out the Project&lt;a class=&quot;headerlink&quot; href=&quot;#laying-out-the-project&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To build your directory tree generator, you’ll create a few &lt;a href=&quot;https://realpython.com/python-modules-packages/&quot;&gt;modules and a package&lt;/a&gt;. Then you’ll give the project a coherent Python &lt;a href=&quot;https://realpython.com/python-application-layouts/&quot;&gt;application layout&lt;/a&gt;. At the end of this tutorial, your project’s root directory will have the following directory structure:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;./rptree_project/
│
├── rptree/
│   ├── rptree.py
│   ├── __init__.py
│   └── cli.py
│
├── README.md
└── tree.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;rptree_project/&lt;/code&gt; directory is the project’s root directory. There, you’ll place the following files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;README.md&lt;/code&gt;&lt;/strong&gt; provides the project description and instructions on installing and running the application. Adding a descriptive and detailed &lt;a href=&quot;https://dbader.org/blog/write-a-great-readme-for-your-github-project&quot;&gt;README&lt;/a&gt; file to your projects is considered a best practice in programming, especially if you’re planning to release the project as an open source solution.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;tree.py&lt;/code&gt;&lt;/strong&gt; provides an entry-point script for you to run the application.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then you have the &lt;code&gt;rptree/&lt;/code&gt; directory that holds a Python package with three modules:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;rptree.py&lt;/code&gt;&lt;/strong&gt; provides the application’s main functionalities.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;__init__.py&lt;/code&gt;&lt;/strong&gt; enables &lt;code&gt;rptree/&lt;/code&gt; as a Python package.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;cli.py&lt;/code&gt;&lt;/strong&gt; provides the command-line interface for the application.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Your directory tree generator tool will run on the command line. It’ll take arguments, process them, and display a directory tree diagram on the terminal window. It can also save the output diagram to a file in &lt;a href=&quot;https://daringfireball.net/projects/markdown/&quot;&gt;markdown&lt;/a&gt; format.&lt;/p&gt;
&lt;h3 id=&quot;outlining-the-solution&quot;&gt;Outlining the Solution&lt;a class=&quot;headerlink&quot; href=&quot;#outlining-the-solution&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Traversing a directory in your file system and generating a user-friendly tree diagram that reflects its contents might not look like a difficult task at first glance. However, when you start thinking about it, you realize that it hides a lot of complexity.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/directory-tree-generator-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/directory-tree-generator-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Start Managing Multiple Python Versions With pyenv</title>
      <id>https://realpython.com/courses/start-with-pyenv/</id>
      <link href="https://realpython.com/courses/start-with-pyenv/"/>
      <updated>2021-04-13T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn how to install multiple Python versions and switch between them with ease, including project-specific virtual environments, with pyenv.</summary>
      <content type="html">
        &lt;p&gt;Have you ever wanted to contribute to a project that supports multiple versions of Python but aren&amp;rsquo;t sure how you would easily &lt;a href=&quot;https://realpython.com/python-testing/&quot;&gt;test&lt;/a&gt; all the versions? Are you ever curious about the latest and greatest versions of Python? Maybe you&amp;rsquo;d like to try out these new features, but you don&amp;rsquo;t want to worry about messing up your &lt;a href=&quot;https://realpython.com/effective-python-environment/&quot;&gt;development environment&lt;/a&gt;. Luckily, managing multiple versions of Python doesn&amp;rsquo;t have to be confusing if you use &lt;code&gt;pyenv&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;This course will provide you with a great overview of how to maximize your time spent working on projects and minimize the time spent in headaches trying to use the right version of Python.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install multiple versions of Python&lt;/li&gt;
&lt;li&gt;Install the latest development version of Python&lt;/li&gt;
&lt;li&gt;Switch between the installed versions&lt;/li&gt;
&lt;li&gt;Use virtual environments with &lt;code&gt;pyenv&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Activate different Python versions and virtual environments automatically&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Start Contributing to Python: Your First Steps</title>
      <id>https://realpython.com/start-contributing-python/</id>
      <link href="https://realpython.com/start-contributing-python/"/>
      <updated>2021-04-12T14:00:00+00:00</updated>
      <summary>In this quick introduction, you&#x27;ll see how you can take your first steps toward contributing to Python. You&#x27;ll discover various ways you can contribute and get to know some of the resources that will help you along the way.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you want to start &lt;strong&gt;contributing&lt;/strong&gt; to open source, then &lt;a href=&quot;https://github.com/python&quot;&gt;Python&lt;/a&gt; is a great project to start with. You’ll not only be making your mark on one of the biggest projects out there, but you’ll also be doing it as part of a vibrant and welcoming &lt;strong&gt;community&lt;/strong&gt;. Open source projects rely on contributions from volunteers like you to grow and evolve, so you’ll be making a real difference to the future of open source software.&lt;/p&gt;
&lt;p&gt;On top of that, contributing to &lt;strong&gt;open source&lt;/strong&gt; is a great way to learn and build your skills, so don’t worry if you don’t feel like an expert. There may be a way to contribute that’s perfect for you, even if you don’t know about it yet. It all starts with your first contribution!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll know:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How you can contribute in a way that matches your &lt;strong&gt;skills&lt;/strong&gt; and &lt;strong&gt;interests&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;resources&lt;/strong&gt; and &lt;strong&gt;tools&lt;/strong&gt; you can use to help you contribute confidently&lt;/li&gt;
&lt;li&gt;Where you can find ideas for fixes to propose in &lt;strong&gt;your first contribution&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/cpython-internals-sample/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-cpython-internals-sample&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Get a sample chapter from CPython Internals: Your Guide to the Python 3 Interpreter&lt;/a&gt; showing you how to unlock the inner workings of the Python language, compile the Python interpreter from source  code, and participate in the development of CPython.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;how-you-can-contribute&quot;&gt;How You Can Contribute&lt;a class=&quot;headerlink&quot; href=&quot;#how-you-can-contribute&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Depending on your interests and skills, you can contribute in a number of different ways. For example, if you want to contribute to &lt;a href=&quot;https://github.com/python/cpython&quot;&gt;CPython&lt;/a&gt;, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fix code bugs&lt;/li&gt;
&lt;li&gt;Write &lt;a href=&quot;https://realpython.com/python-testing/&quot;&gt;unit tests&lt;/a&gt; for functions in the &lt;a href=&quot;https://docs.python.org/3/library/&quot;&gt;standard library&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Write &lt;a href=&quot;https://realpython.com/documenting-python-code/&quot;&gt;documentation&lt;/a&gt; for functions in the standard library&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But if you want to contribute in other areas, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Write documentation for the &lt;a href=&quot;https://devguide.python.org/&quot;&gt;Python Developer’s Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://devguide.python.org/documenting/?highlight=translation#translating&quot;&gt;Translate&lt;/a&gt; documentation&lt;/li&gt;
&lt;li&gt;Use your front end skills to &lt;a href=&quot;https://github.com/python/pythondotorg&quot;&gt;improve Python’s official site&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also help review &lt;a href=&quot;https://github.com/python/cpython/pulls&quot;&gt;pull requests from other contributors&lt;/a&gt;. The &lt;strong&gt;core developers&lt;/strong&gt; have a lot of work on their hands, so if you can help move some issues forward, then you’ll be helping Python get better faster.&lt;/p&gt;
&lt;h2 id=&quot;how-to-get-the-resources-youll-need&quot;&gt;How to Get the Resources You’ll Need&lt;a class=&quot;headerlink&quot; href=&quot;#how-to-get-the-resources-youll-need&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When you start contributing to an open source project, there can be a lot of information to take in all at once.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/start-contributing-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/start-contributing-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #55: Getting Started With Refactoring Your Python Code</title>
      <id>https://realpython.com/podcasts/rpp/55/</id>
      <link href="https://realpython.com/podcasts/rpp/55/"/>
      <updated>2021-04-09T12:00:00+00:00</updated>
      <summary>Do you think it&#x27;s time to refactor your Python code? What should you think about before starting this task? This week on the show, we have Brendan Maginnis and Nick Thapen from Sourcery. Sourcery is an automated refactoring tool that integrates into your IDE and suggests improvements to your code.</summary>
      <content type="html">
        &lt;p&gt;Do you think it&#x27;s time to refactor your Python code? What should you think about before starting this task? This week on the show, we have Brendan Maginnis and Nick Thapen from Sourcery. Sourcery is an automated refactoring tool that integrates into your IDE and suggests improvements to your code.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The k-Nearest Neighbors (kNN) Algorithm in Python</title>
      <id>https://realpython.com/knn-python/</id>
      <link href="https://realpython.com/knn-python/"/>
      <updated>2021-04-07T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn all about the k-Nearest Neighbors (kNN) algorithm in Python, including how to implement kNN from scratch, kNN hyperparameter tuning, and improving kNN performance using bagging.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In this tutorial, you’ll get a thorough introduction to the k-Nearest Neighbors (kNN) algorithm in Python. The kNN algorithm is one of the most famous &lt;a href=&quot;https://realpython.com/learning-paths/machine-learning-python/&quot;&gt;machine learning&lt;/a&gt; algorithms and an absolute must-have in your machine learning toolbox. Python is the go-to programming language for machine learning, so what better way to discover kNN than with Python’s famous packages &lt;a href=&quot;https://realpython.com/numpy-tutorial/&quot;&gt;NumPy&lt;/a&gt; and &lt;a href=&quot;https://scikit-learn.org/stable/&quot;&gt;scikit-learn&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;Below, you’ll explore the kNN algorithm both in theory and in practice. While many tutorials skip the theoretical part and focus only on the use of libraries, you don’t want to be dependent on automated packages for your machine learning. It’s important to learn about the mechanics of machine learning algorithms to understand their potential and limitations.&lt;/p&gt;
&lt;p&gt;At the same time, it’s essential to understand how to use an algorithm in practice. With that in mind, in the second part of this tutorial, you’ll focus on the use of kNN in the Python library scikit-learn, with advanced tips for pushing performance to the max.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Explain the &lt;strong&gt;kNN algorithm&lt;/strong&gt; both intuitively and mathematically&lt;/li&gt;
&lt;li&gt;Implement kNN in Python &lt;strong&gt;from scratch&lt;/strong&gt; using &lt;strong&gt;NumPy&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use kNN in Python with &lt;strong&gt;scikit-learn&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Tune &lt;strong&gt;hyperparameters&lt;/strong&gt; of kNN using &lt;code&gt;GridSearchCV&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add &lt;strong&gt;bagging&lt;/strong&gt; to kNN for better performance &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;#&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-numpy-learning-guide&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a free NumPy Resources Guide&lt;/a&gt; that points you to the best tutorials, videos, and books for improving your NumPy skills.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;basics-of-machine-learning&quot;&gt;Basics of Machine Learning&lt;a class=&quot;headerlink&quot; href=&quot;#basics-of-machine-learning&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To get you on board, it’s worth taking a step back and doing a quick survey of &lt;strong&gt;machine learning&lt;/strong&gt; in general. In this section, you’ll get an introduction to the fundamental idea behind machine learning, and you’ll see how the kNN algorithm relates to other machine learning tools.&lt;/p&gt;
&lt;p&gt;The general idea of machine learning is to get a model to learn trends from historical data on any topic and be able to reproduce those trends on comparable data in the future. Here’s a diagram outlining the basic machine learning process:&lt;/p&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/knn_01_MLgeneral_wide.74e5e2dc1094.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/knn_01_MLgeneral_wide.74e5e2dc1094.png&quot; width=&quot;3024&quot; height=&quot;1512&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/knn_01_MLgeneral_wide.74e5e2dc1094.png&amp;amp;w=756&amp;amp;sig=bd86f8e015dacfb709f41c5f2288da72f253e8ec 756w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/knn_01_MLgeneral_wide.74e5e2dc1094.png&amp;amp;w=1512&amp;amp;sig=492d6c64473418b06336cebadf7eb78bb7662e12 1512w, https://files.realpython.com/media/knn_01_MLgeneral_wide.74e5e2dc1094.png 3024w&quot; sizes=&quot;75vw&quot; alt=&quot;General Idea Behind of Machine Learning&quot; data-asset=&quot;3232&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;This graph is a visual representation of a machine learning model that is fitted onto historical data. On the left are the original observations with three variables: height, width, and shape. The shapes are stars, crosses, and triangles. &lt;/p&gt;
&lt;p&gt;The shapes are located in different areas of the graph. On the right, you see how those original observations have been translated to a decision rule. For a new observation, you need to know the width and the height to determine in which square it falls. The square in which it falls, in turn, defines which shape it is most likely to have. &lt;/p&gt;
&lt;p&gt;Many different models could be used for this task. A &lt;strong&gt;model&lt;/strong&gt; is a mathematical formula that can be used to describe data points. One example is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Linear_model&quot;&gt;linear model&lt;/a&gt;, which uses a &lt;a href=&quot;https://en.wikipedia.org/wiki/Linear_function&quot;&gt;linear function&lt;/a&gt; defined by the formula &lt;code&gt;y = ax + b&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you estimate, or &lt;strong&gt;fit&lt;/strong&gt;, a model, you find the optimal values for the fixed parameters using some algorithm. In the linear model, the parameters are &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;. Luckily, you won’t have to invent such estimation algorithms to get started. They’ve already been discovered by great mathematicians.&lt;/p&gt;
&lt;p&gt;Once the model is estimated, it becomes a mathematical formula in which you can fill in values for your independent variables to make predictions for your target variable. From a high-level perspective, that’s all that happens!&lt;/p&gt;
&lt;h2 id=&quot;distinguishing-features-of-knn&quot;&gt;Distinguishing Features of kNN&lt;a class=&quot;headerlink&quot; href=&quot;#distinguishing-features-of-knn&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Now that you understand the basic idea behind machine learning, the next step is understanding why there are so many models available. The linear model that you just saw is called &lt;a href=&quot;https://realpython.com/linear-regression-in-python/&quot;&gt;linear regression&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Linear regression works in some cases but doesn’t always make very precise predictions. That’s why mathematicians have come up with many alternative machine learning models that you can use. The k-Nearest Neighbors algorithm is one of them.&lt;/p&gt;
&lt;p&gt;All these models have their peculiarities. If you work on machine learning, you should have a deep understanding of all of them so that you can use the right model in the right situation. To understand why and when to use kNN, you’ll next look at how kNN compares to other machine learning models.&lt;/p&gt;
&lt;h3 id=&quot;knn-is-a-supervised-machine-learning-algorithm&quot;&gt;kNN Is a Supervised Machine Learning Algorithm&lt;a class=&quot;headerlink&quot; href=&quot;#knn-is-a-supervised-machine-learning-algorithm&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The first determining property of machine learning algorithms is the split between &lt;strong&gt;supervised&lt;/strong&gt; and &lt;strong&gt;unsupervised&lt;/strong&gt; models. The difference between supervised and unsupervised models is the &lt;strong&gt;problem statement&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In supervised models, you have two types of variables at the same time:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A &lt;strong&gt;target variable&lt;/strong&gt;, which is also called the dependent variable or the &lt;code&gt;y&lt;/code&gt; variable. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Independent variables&lt;/strong&gt;, which are also known as &lt;code&gt;x&lt;/code&gt; variables or explanatory variables.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The target variable is the variable that you want to predict. It depends on the independent variables and it isn’t something that you know ahead of time. The independent variables are variables that you do know ahead of time. You can plug them into an equation to predict the target variable. In this way, it’s relatively similar to the &lt;code&gt;y = ax + b&lt;/code&gt; case. &lt;/p&gt;
&lt;p&gt;In the graph that you’ve seen before and the following graphs in this section, the target variable is the shape of the data point, and the independent variables are height and width. You can see the idea behind supervised learning in the following graph:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/knn-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/knn-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python vs Java: Object Oriented Programming</title>
      <id>https://realpython.com/courses/python-vs-java-object-oriented-programming/</id>
      <link href="https://realpython.com/courses/python-vs-java-object-oriented-programming/"/>
      <updated>2021-04-06T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn about the practical differences in Python vs Java for object-oriented programming. By the end, you&#x27;ll be able to apply your knowledge to Python, understand how to reinterpret your understanding of Java objects to Python, and use objects in a Pythonic way.</summary>
      <content type="html">
        &lt;p&gt;Java programmers making a move to Python often struggle with Python&amp;rsquo;s approach to object-oriented programming (OOP). The approach to working with objects, variable types, and other language capabilities taken by Python vs Java are quite different. It can make switching between both languages very confusing.&lt;/p&gt;
&lt;p&gt;This course compares and contrasts object-oriented programming support in Python vs Java. By the end, you&amp;rsquo;ll be able to apply your knowledge of object-oriented programming to Python, understand how to reinterpret your understanding of Java objects to Python, and use objects in a Pythonic way.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Build a basic class in both Java and Python&lt;/li&gt;
&lt;li&gt;Explore how object attributes work in Python vs Java&lt;/li&gt;
&lt;li&gt;Compare and contrast Java methods and Python functions&lt;/li&gt;
&lt;li&gt;Discover inheritance and polymorphism mechanisms in both languages&lt;/li&gt;
&lt;li&gt;Investigate reflection across Python vs Java&lt;/li&gt;
&lt;li&gt;Apply everything in a complete class implementation in both languages&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This course isn&amp;rsquo;t a primer on object-oriented programming. Rather, it compares object-oriented features and principles of Python vs Java. Students should have some knowledge of Java, and also be familiar with coding Python. If you are unfamiliar with object-oriented programming, then check out &lt;a href=&quot;https://realpython.com/courses/intro-object-oriented-programming-oop-python/&quot;&gt;Intro to Object-Oriented Programming (OOP) in Python&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python News: What&#x27;s New From March 2021?</title>
      <id>https://realpython.com/python-news-march-2021/</id>
      <link href="https://realpython.com/python-news-march-2021/"/>
      <updated>2021-04-05T14:00:00+00:00</updated>
      <summary>March 2021 was full of exciting Python news! Quickly get up to speed on what&#x27;s been happening in the world of Python in the past month. You&#x27;ll see everything from structural pattern matching to the 2020 Python Developers Survey.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Dynamic_programming_language&quot;&gt;dynamic language&lt;/a&gt; in more ways than one: Not only is it not a static language like C or C++, but it’s also constantly evolving. If you want to get up to speed on what happened in the world of &lt;strong&gt;Python&lt;/strong&gt; in &lt;strong&gt;March 2021&lt;/strong&gt;, then you’ve come to the right place to get your &lt;strong&gt;news&lt;/strong&gt;!&lt;/p&gt;
&lt;p&gt;March 2021 marks a notable change to the core of the Python language with the addition of &lt;a href=&quot;https://www.python.org/dev/peps/pep-0636/&quot;&gt;structural pattern matching&lt;/a&gt;, which is available for testing now in the latest &lt;a href=&quot;https://pythoninsider.blogspot.com/2021/03/python-3100a6-is-now-available-for.html&quot;&gt;alpha release of Python 3.10.0&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Beyond changes to the language itself, March was a month full of exciting and historical moments for Python. The language &lt;a href=&quot;https://pyfound.blogspot.com/2021/03/happy-anniversary-to-python-and-python.html&quot;&gt;celebrated its 30th birthday&lt;/a&gt; and became one of the first open-source technologies to &lt;a href=&quot;https://twitter.com/thepsf/status/1362516507918483458&quot;&gt;land on another planet&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let’s dive into the biggest Python news from the past month!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-mastery-course/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mastery-course&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;5 Thoughts On Python Mastery&lt;/a&gt;, a free course for Python developers that shows you the roadmap and the mindset you’ll need to take your Python skills to the next level.&lt;/p&gt;
&lt;/div&gt;
&lt;h3 id=&quot;python-turns-30-years-old&quot;&gt;Python Turns 30 Years Old&lt;a class=&quot;headerlink&quot; href=&quot;#python-turns-30-years-old&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Although Python’s actual birth date is &lt;a href=&quot;https://python-history.blogspot.com/2009/01/brief-timeline-of-python.html&quot;&gt;February 20, 1991&lt;/a&gt;, which is when &lt;a href=&quot;https://github.com/smontanaro/python-0.9.1&quot;&gt;version 0.9.0&lt;/a&gt; was released, March is a good month to celebrate. This March is the &lt;a href=&quot;https://pyfound.blogspot.com/2021/03/happy-anniversary-to-python-and-python.html&quot;&gt;20th anniversary&lt;/a&gt; of the &lt;a href=&quot;https://www.python.org/psf/&quot;&gt;Python Software Foundation&lt;/a&gt;, which was founded on March 6, 2001.&lt;/p&gt;
&lt;p&gt;In its thirty years, Python has changed—a lot—both as a language and as an organization. The transition from Python 2 to Python 3 &lt;a href=&quot;https://www.python.org/doc/sunset-python-2/#:~:text=The%20sunset%20date%20has%20now,when%20we%20released%20Python%202.7.&quot;&gt;took a decade to complete&lt;/a&gt;. The organizational model for decision-making changed too: The creator of the language, Guido van Rossum, used to be at the helm, but a five-person steering council was created in 2018 to plan the future of Python.&lt;/p&gt;
&lt;p&gt;Happy birthday, Python! Here’s to many more years 🥂&lt;/p&gt;
&lt;h3 id=&quot;structural-pattern-matching-comes-to-python-3100&quot;&gt;Structural Pattern Matching Comes to Python 3.10.0&lt;a class=&quot;headerlink&quot; href=&quot;#structural-pattern-matching-comes-to-python-3100&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Python 3.10.0 is the next minor version of Python and is &lt;a href=&quot;https://www.python.org/dev/peps/pep-0619/&quot;&gt;expected to drop on October 4, 2021&lt;/a&gt;. This update will bring a big addition to the core syntax: &lt;strong&gt;structural pattern matching&lt;/strong&gt;, which was proposed in &lt;a href=&quot;https://www.python.org/dev/peps/pep-0634/&quot;&gt;PEP 634&lt;/a&gt;. You could say that structural pattern matching adds a sort of &lt;a href=&quot;https://en.wikipedia.org/wiki/Switch_statement&quot;&gt;&lt;code&gt;switch&lt;/code&gt; statement&lt;/a&gt; to Python, but that isn’t entirely accurate. Pattern matching does much more.&lt;/p&gt;
&lt;p&gt;For instance, take an example from &lt;a href=&quot;https://www.python.org/dev/peps/pep-0635/&quot;&gt;PEP 635&lt;/a&gt;. Suppose you need to check if an object &lt;code&gt;x&lt;/code&gt; is a tuple containing host and port information for a socket connection and, optionally, a mode such as HTTP or HTTPS. You could write something like this using an &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;&lt;code&gt;if&lt;/code&gt;…&lt;code&gt;elif&lt;/code&gt;…&lt;code&gt;else&lt;/code&gt;&lt;/a&gt; block:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-news-march-2021/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-news-march-2021/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #54: Building a Neural Network and How to Write Tests in Python</title>
      <id>https://realpython.com/podcasts/rpp/54/</id>
      <link href="https://realpython.com/podcasts/rpp/54/"/>
      <updated>2021-04-02T12:00:00+00:00</updated>
      <summary>Do you know how a neural network functions? What goes into building one from scratch using Python? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Do you know how a neural network functions? What goes into building one from scratch using Python? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Community Interview With Will McGugan</title>
      <id>https://realpython.com/interview-will-mcgugan/</id>
      <link href="https://realpython.com/interview-will-mcgugan/"/>
      <updated>2021-03-31T14:00:00+00:00</updated>
      <summary>In this interview, we&#x27;re joined by Will McGugan, a freelance Python developer based in Scotland and the creator of the popular Python library Rich. We discuss the origins of Rich, what it&#x27;s like to maintain a popular Python package, building chess engines, and Will&#x27;s love of photography.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Today I’m joined by &lt;a href=&quot;https://twitter.com/willmcgugan&quot;&gt;Will McGugan&lt;/a&gt;. Will is a freelance Python developer based in Scotland and the creator of the popular Python library &lt;a href=&quot;https://pypi.org/project/rich/&quot;&gt;&lt;code&gt;Rich&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this interview, we discuss the origins of &lt;code&gt;Rich&lt;/code&gt;, what it’s like to maintain a popular Python package, building chess engines, and Will’s love of photography.&lt;/p&gt;
&lt;p class=&quot;mt-5&quot;&gt;&lt;strong&gt;Ricky:&lt;/strong&gt; &lt;em&gt;Thanks for joining me for this interview, Will. I’d like to start in the same manner we do with all our guests: how did you get into programming, and when did you start using Python?&lt;/em&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid w-25 float-right ml-3 rounded-circle&quot; src=&quot;https://files.realpython.com/media/WillMcGugan-square.92efc493faf2.jpg&quot; width=&quot;1934&quot; height=&quot;1934&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/WillMcGugan-square.92efc493faf2.jpg&amp;amp;w=483&amp;amp;sig=94fc43d642a7fa3dec28068176f3323ceb38d441 483w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/WillMcGugan-square.92efc493faf2.jpg&amp;amp;w=967&amp;amp;sig=f6aee573248c6275abe4c7618978482e4decac8d 967w, https://files.realpython.com/media/WillMcGugan-square.92efc493faf2.jpg 1934w&quot; sizes=&quot;75vw&quot; alt=&quot;Headshot of Will McGugan&quot; data-asset=&quot;3542&quot;&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Will:&lt;/strong&gt; Thanks for having me on!&lt;/p&gt;
&lt;p&gt;I discovered programming as a kid in the ’80s. For younger readers, it was exactly like &lt;em&gt;Stranger Things&lt;/em&gt;, minus the CGI monsters. We had a ZX Spectrum+ computer back then. The graphics were flickery, and the sound was tinny, but I was hooked. At some point I discovered that you could type things on the keyboard and—if you did it just right—the computer would do as you told it.&lt;/p&gt;
&lt;p&gt;Fast-forward a few years, and I’m working in the video games industry. I’m building a game engine and looking for a scripting language to handle the game mechanics while C++ does the graphics and heavy lifting. That’s when I came across Python, version 2.1, I think. &lt;/p&gt;
&lt;p&gt;I didn’t consider it a proper programming language at the time, probably because it was too easy to use, and programming should be hard, right? Even so, I found myself coming back to Python for scripts and tools, which gradually became more sophisticated. &lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/interview-will-mcgugan/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/interview-will-mcgugan/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Understanding Python List Comprehensions</title>
      <id>https://realpython.com/courses/understand-list-comprehensions/</id>
      <link href="https://realpython.com/courses/understand-list-comprehensions/"/>
      <updated>2021-03-30T14:00:00+00:00</updated>
      <summary>Python list comprehensions make it easy to create lists while performing sophisticated filtering, mapping, and conditional logic on their members. In this course, you&#x27;ll learn when to use a list comprehension in Python and how to create them effectively.</summary>
      <content type="html">
        &lt;p&gt;One of Python&amp;rsquo;s most distinctive features is the &lt;strong&gt;list comprehension&lt;/strong&gt;, which you can use to create powerful functionality within a single line of code. However, many developers struggle to fully leverage the more advanced features, or use them too much, which can lead to code that&amp;rsquo;s less efficient and harder to read.&lt;/p&gt;
&lt;p&gt;By the end of this course, you&amp;rsquo;ll understand the full power of Python list comprehensions and how to use their features comfortably. You&amp;rsquo;ll also gain an understanding of the trade-offs that come with using them so that you can determine when other approaches are more preferable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rewrite loops and &lt;code&gt;map()&lt;/code&gt; calls as a &lt;strong&gt;list comprehension&lt;/strong&gt; in Python&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Choose&lt;/strong&gt; between comprehensions, loops, and &lt;code&gt;map()&lt;/code&gt; calls&lt;/li&gt;
&lt;li&gt;Supercharge your comprehensions with &lt;strong&gt;conditional logic&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use comprehensions&lt;/strong&gt; to replace &lt;code&gt;filter()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Profile&lt;/strong&gt; your code to solve performance questions&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>OrderedDict vs dict in Python: The Right Tool for the Job</title>
      <id>https://realpython.com/python-ordereddict/</id>
      <link href="https://realpython.com/python-ordereddict/"/>
      <updated>2021-03-29T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn what Python&#x27;s OrderedDict is and how to use it in your code. You&#x27;ll also learn about the main differences between regular dictionaries and ordered dictionaries.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Sometimes you need a Python &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionary&lt;/a&gt; that remembers the order of its items. In the past, you had only one tool for solving this specific problem: Python’s &lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.OrderedDict&quot;&gt;&lt;code&gt;OrderedDict&lt;/code&gt;&lt;/a&gt;. It’s a dictionary subclass specially designed to remember the order of items, which is defined by the insertion order of keys.&lt;/p&gt;
&lt;p&gt;This changed in Python 3.6. The built-in &lt;code&gt;dict&lt;/code&gt; class now keeps its items ordered as well. Because of that, many in the Python community now wonder if &lt;code&gt;OrderedDict&lt;/code&gt; is still useful. A closer look at &lt;code&gt;OrderedDict&lt;/code&gt; will uncover that this class still provides valuable features.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create and use &lt;strong&gt;&lt;code&gt;OrderedDict&lt;/code&gt; objects&lt;/strong&gt; in your code&lt;/li&gt;
&lt;li&gt;Identify the &lt;strong&gt;differences&lt;/strong&gt; between &lt;code&gt;OrderedDict&lt;/code&gt; and &lt;code&gt;dict&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Understand the &lt;strong&gt;pros&lt;/strong&gt; and &lt;strong&gt;cons&lt;/strong&gt; of using &lt;code&gt;OrderedDict&lt;/code&gt; vs &lt;code&gt;dict&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With this knowledge, you’ll able to choose the dictionary class that best fits your needs when you want to preserve the order of items.&lt;/p&gt;
&lt;p&gt;By the end of the tutorial, you’ll see an example of implementing a dictionary-based queue using &lt;code&gt;OrderedDict&lt;/code&gt;, which would be more challenging if you used a regular &lt;code&gt;dict&lt;/code&gt; object.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-cheat-sheet-shortened&quot; data-focus=&quot;false&quot;&gt;Click here to get a Python Cheat Sheet&lt;/a&gt; and learn the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;choosing-between-ordereddict-and-dict&quot;&gt;Choosing Between &lt;code&gt;OrderedDict&lt;/code&gt; and &lt;code&gt;dict&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#choosing-between-ordereddict-and-dict&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For years, Python &lt;a href=&quot;https://realpython.com/iterate-through-dictionary-python/#a-few-words-on-dictionaries&quot;&gt;dictionaries&lt;/a&gt; were unordered &lt;a href=&quot;https://realpython.com/python-data-structures/&quot;&gt;data structures&lt;/a&gt;. Python developers were used to this fact, and they relied on &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt; or other sequences when they needed to keep their data in order. With time, developers found a need for a new type of dictionary, one that would keep its items ordered.&lt;/p&gt;
&lt;p&gt;Back in 2008, &lt;a href=&quot;https://www.python.org/dev/peps/pep-0372/&quot;&gt;PEP 372&lt;/a&gt; introduced the idea of adding a new dictionary class to &lt;a href=&quot;https://docs.python.org/3/library/collections.html#module-collections&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt;. Its main goal was to remember the order of items as defined by the order in which keys were inserted. That was the origin of &lt;code&gt;OrderedDict&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Core Python developers wanted to fill in the gap and provide a dictionary that could preserve the order of inserted keys. That, in turn, allowed for a more straightforward implementation of specific algorithms that rely on this property.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;OrderedDict&lt;/code&gt; was added to the standard library in &lt;a href=&quot;https://docs.python.org/3/whatsnew/3.1.html&quot;&gt;Python 3.1&lt;/a&gt;. Its API is essentially the same as &lt;code&gt;dict&lt;/code&gt;. However, &lt;code&gt;OrderedDict&lt;/code&gt; iterates over keys and values in the same order that the keys were inserted. If a new entry overwrites an existing entry, then the order of items is left unchanged. If an entry is deleted and reinserted, then it will be moved to the end of the dictionary.&lt;/p&gt;
&lt;p&gt;Python 3.6 introduced a &lt;a href=&quot;https://docs.python.org/3/whatsnew/3.6.html#new-dict-implementation&quot;&gt;new implementation of &lt;code&gt;dict&lt;/code&gt;&lt;/a&gt;. This new implementation represents a big win in terms of memory usage and iteration efficiency. Additionally, the new implementation provides a new and somewhat unexpected feature: &lt;code&gt;dict&lt;/code&gt; objects now keep their items in the same order they were introduced. Initially, this feature was considered an implementation detail, and the documentation advised against relying on it.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In this tutorial, you’ll focus on the implementations of &lt;code&gt;dict&lt;/code&gt; and &lt;code&gt;OrderedDict&lt;/code&gt; that &lt;a href=&quot;https://www.python.org/about/&quot;&gt;CPython&lt;/a&gt; provides.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;In the words of &lt;a href=&quot;https://twitter.com/raymondh&quot;&gt;Raymond Hettinger&lt;/a&gt;, core Python developer and coauthor of &lt;code&gt;OrderedDict&lt;/code&gt;, the class was specially designed to keep its items ordered, whereas the new implementation of &lt;code&gt;dict&lt;/code&gt; was designed to be compact and to provide fast iteration:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The current regular dictionary is based on the design I proposed several years ago. The primary goals of that design were compactness and faster iteration over the dense arrays of keys and values. Maintaining order was an artifact rather than a design goal. The design can maintain order but that is not its specialty.&lt;/p&gt;
&lt;p&gt;In contrast, I gave &lt;code&gt;collections.OrderedDict&lt;/code&gt; a different design (later coded in C by Eric Snow). The primary goal was to have efficient maintenance of order even for severe workloads such as that imposed by the &lt;code&gt;lru_cache&lt;/code&gt; which frequently alters order without touching the underlying &lt;code&gt;dict&lt;/code&gt;. Intentionally, the &lt;code&gt;OrderedDict&lt;/code&gt; has a design that prioritizes ordering capabilities at the expense of additional memory overhead and a constant factor worse insertion time.&lt;/p&gt;
&lt;p&gt;It is still my goal to have &lt;code&gt;collections.OrderedDict&lt;/code&gt; have a different design with different performance characteristics than regular dicts. It has some order specific methods that regular dicts don’t have (such as a &lt;code&gt;move_to_end()&lt;/code&gt; and a &lt;code&gt;popitem()&lt;/code&gt; that pops efficiently from either end). The &lt;code&gt;OrderedDict&lt;/code&gt; needs to be good at those operations because that is what differentiates it from regular dicts. (&lt;a href=&quot;https://mail.python.org/pipermail/python-dev/2017-December/151266.html&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In &lt;a href=&quot;https://realpython.com/python37-new-features/&quot;&gt;Python 3.7&lt;/a&gt;, the items-ordered feature of &lt;code&gt;dict&lt;/code&gt; objects was &lt;a href=&quot;https://mail.python.org/pipermail/python-dev/2017-December/151283.html&quot;&gt;declared&lt;/a&gt; an official part of the Python language specification. So, from that point on, developers could rely on &lt;code&gt;dict&lt;/code&gt; when they needed a dictionary that keeps its items ordered.&lt;/p&gt;
&lt;p&gt;At this point, a question arises: Is &lt;code&gt;OrderedDict&lt;/code&gt; still needed after this new implementation of &lt;code&gt;dict&lt;/code&gt;? The answer depends on your specific use case and also on how explicit you want to be in your code.&lt;/p&gt;
&lt;p&gt;At the time of writing, some features of &lt;code&gt;OrderedDict&lt;/code&gt; still made it valuable and different from a regular &lt;code&gt;dict&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Intent signaling:&lt;/strong&gt; If you use &lt;code&gt;OrderedDict&lt;/code&gt; over &lt;code&gt;dict&lt;/code&gt;, then your code makes it clear that the order of items in the dictionary is important. You’re clearly communicating that your code needs or relies on the order of items in the underlying dictionary.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Control over the order of items:&lt;/strong&gt; If you need to rearrange or reorder the items in a dictionary, then you can use &lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.OrderedDict.move_to_end&quot;&gt;&lt;code&gt;.move_to_end()&lt;/code&gt;&lt;/a&gt; and also the enhanced variation of &lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.OrderedDict.popitem&quot;&gt;&lt;code&gt;.popitem()&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Equality test behavior:&lt;/strong&gt; If your code compares dictionaries for equality, and the order of items is important in that comparison, then &lt;code&gt;OrderedDict&lt;/code&gt; is the right choice.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There’s at least one more reason to continue using &lt;code&gt;OrderedDict&lt;/code&gt; in your code: &lt;strong&gt;backward compatibility&lt;/strong&gt;. Relying on regular &lt;code&gt;dict&lt;/code&gt; objects to preserve the order of items will break your code in environments that run versions of Python older than 3.6.&lt;/p&gt;
&lt;p&gt;It’s difficult to say if &lt;code&gt;dict&lt;/code&gt; will fully replace &lt;code&gt;OrderedDict&lt;/code&gt; soon. Nowadays, &lt;code&gt;OrderedDict&lt;/code&gt; still offers interesting and valuable features that you might want to consider when selecting a tool for a given job.&lt;/p&gt;
&lt;h2 id=&quot;getting-started-with-pythons-ordereddict&quot;&gt;Getting Started With Python’s &lt;code&gt;OrderedDict&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#getting-started-with-pythons-ordereddict&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python’s &lt;code&gt;OrderedDict&lt;/code&gt; is a &lt;code&gt;dict&lt;/code&gt; subclass that preserves the order in which &lt;strong&gt;key-value pairs&lt;/strong&gt;, commonly known as &lt;strong&gt;items&lt;/strong&gt;, are inserted into the dictionary. When you iterate over an &lt;code&gt;OrderedDict&lt;/code&gt; object, items are traversed in the original order. If you update the value of an existing key, then the order remains unchanged. If you remove an item and reinsert it, then the item is added at the end of the dictionary.&lt;/p&gt;
&lt;p&gt;Being a &lt;code&gt;dict&lt;/code&gt; subclass means that it inherits all the methods a regular dictionary provides. &lt;code&gt;OrderedDict&lt;/code&gt; also has additional features that you’ll learn about in this tutorial. In this section, however, you’ll learn the basics of creating and using &lt;code&gt;OrderedDict&lt;/code&gt; objects in your code.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-ordereddict/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-ordereddict/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #53: Improving the Learning Experience on Real Python</title>
      <id>https://realpython.com/podcasts/rpp/53/</id>
      <link href="https://realpython.com/podcasts/rpp/53/"/>
      <updated>2021-03-26T12:00:00+00:00</updated>
      <summary>If you haven&#x27;t visited the website lately, then you&#x27;re missing out on the updates to realpython.com! The site features a completely refreshed layout with multiple sections to help you take advantage of even more great educational Python content. This week on the show, we have Dan Bader, the person behind Real Python, and all these architectural changes.</summary>
      <content type="html">
        &lt;p&gt;If you haven&#x27;t visited the website lately, then you&#x27;re missing out on the updates to realpython.com! The site features a completely refreshed layout with multiple sections to help you take advantage of even more great educational Python content. This week on the show, we have Dan Bader, the person behind Real Python, and all these architectural changes.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Community Interview With Dane Hillard</title>
      <id>https://realpython.com/interview-dane-hillard/</id>
      <link href="https://realpython.com/interview-dane-hillard/"/>
      <updated>2021-03-24T14:00:00+00:00</updated>
      <summary>Dane Hillard is a Real Python contributor and author of the book Practices of the Python Pro. In this interview, we discuss a variety of topics, including code complexity, Python package maintenance, and popcorn.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Today I’m joined by &lt;a href=&quot;https://realpython.com/team/dhillard/&quot;&gt;Dane Hillard&lt;/a&gt;, lead web application developer at &lt;a href=&quot;https://www.ithaka.org&quot;&gt;ITHAKA&lt;/a&gt; and author of &lt;a href=&quot;https://realpython.com/asins/1617296082/&quot;&gt;&lt;em&gt;Practices of the Python Pro&lt;/em&gt;&lt;/a&gt;. Dane is also a &lt;em&gt;Real Python&lt;/em&gt; &lt;a href=&quot;https://realpython.com/team/dhillard/&quot;&gt;tutorial author&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this interview, we discuss a variety of topics, including code complexity, Python package maintenance, and popcorn. So without further ado, let’s welcome Dane.&lt;/p&gt;
&lt;p class=&quot;mt-5&quot;&gt;&lt;strong&gt;Ricky:&lt;/strong&gt; &lt;em&gt;Thanks for joining me for this interview, Dane. I’d like to start in the same manner we do with all our guests: how did you get into programming, and when did you start using Python?&lt;/em&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid w-25 float-right ml-3 rounded-circle&quot; src=&quot;https://files.realpython.com/media/profilenew.cf86e4c32676.jpg&quot; width=&quot;1050&quot; height=&quot;1050&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/profilenew.cf86e4c32676.jpg&amp;amp;w=262&amp;amp;sig=f2565794539d8f69107ebc71d9fb2fb93574be43 262w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/profilenew.cf86e4c32676.jpg&amp;amp;w=525&amp;amp;sig=0839a61c255ee681592215f80cdf9c8fe58e2f2c 525w, https://files.realpython.com/media/profilenew.cf86e4c32676.jpg 1050w&quot; sizes=&quot;75vw&quot; alt=&quot;Dane Hillard&quot; data-asset=&quot;1668&quot;&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Dane:&lt;/strong&gt; Thanks for having me back! &lt;em&gt;Real Python&lt;/em&gt; is a pretty nice place to spend some more time. Some of my first experiences with programming were the same for a lot of kids from the era of LiveJournal and MySpace—I was regularly customizing my profile page and theme to make sure my angsty ramblings looked their best.&lt;/p&gt;
&lt;p&gt;Around the same time, I started doing some 3D modeling in &lt;a href=&quot;https://www.rhino3d.com/&quot;&gt;Rhinoceros&lt;/a&gt; as a mostly artistic outlet, but it also offered some scripting capabilities that I tinkered with. A friend and I got pretty into &lt;a href=&quot;https://en.wikipedia.org/wiki/Liero&quot;&gt;Liero&lt;/a&gt;, and I went so far as to make a few custom weapons for us to play with. So in all, a geeky start coming out of a few tangential interests.&lt;/p&gt;
&lt;p&gt;I learned C++ and MATLAB in school and spent my first internship and full-time job working in those languages. I picked up Perl along the way and managed to land my second job using it. &lt;/p&gt;
&lt;p&gt;While learning a massive amount about SQL optimization there, I also started tinkering on some side projects with a friend. He was a big &lt;a href=&quot;https://rubyonrails.org/&quot;&gt;Rails&lt;/a&gt; guy, so I started getting exposure to Ruby. I’d been using PHP and then Spring to run a website for &lt;a href=&quot;https://www.danehillard.com&quot;&gt;my photography&lt;/a&gt; and decided to give Rails a try next. The “coding by convention” paradigm didn’t quite click with me at that time.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/interview-dane-hillard/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/interview-dane-hillard/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Records and Sets: Selecting the Ideal Data Structure</title>
      <id>https://realpython.com/courses/records-sets-ideal-data-structure/</id>
      <link href="https://realpython.com/courses/records-sets-ideal-data-structure/"/>
      <updated>2021-03-23T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn about two of Python&#x27;s data structures: records and sets. You&#x27;ll look at multiple types and classes for both of these and learn which implementations are best for your specific use cases.</summary>
      <content type="html">
        &lt;p&gt;There are a variety of ways for storing and managing data in your program and the choice of the right data structure has an effect on the readability of your code, ease of writing, and performance. Python has a wide selection of built-in mechanisms that meet most of your data structure needs. This course introduces you to two types of data structures: data records and sets. &lt;/p&gt;
&lt;p&gt;There are multiple types and classes for both of these data structures and this course discusses them and provides information on how to choose the right one.&lt;/p&gt;
&lt;p&gt;In this course you&amp;rsquo;ll learn about:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What are the &lt;strong&gt;advantages&lt;/strong&gt; of using the built-in &lt;code&gt;dict&lt;/code&gt; type as a Data Record&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;flexibility&lt;/strong&gt; do DataClasses add for Records compared to regular Classes&lt;/li&gt;
&lt;li&gt;How to store &lt;strong&gt;C-type Data&lt;/strong&gt; with &lt;code&gt;struct.Struct&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;define&lt;/strong&gt; Sets &lt;/li&gt;
&lt;li&gt;Where to use a &lt;strong&gt;Frozenset&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;create a counter&lt;/strong&gt; with a multiset&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The course is the &lt;strong&gt;second&lt;/strong&gt; part of an ongoing series, exploring how to find the right Data Structure for your projects. The &lt;strong&gt;first&lt;/strong&gt; course is &lt;a href=&quot;https://realpython.com/courses/dicts-arrays-ideal-data-structure/&quot;&gt;Dictionaries and Arrays: Selecting the Ideal Data Structure&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Build an Asteroids Game With Python and Pygame</title>
      <id>https://realpython.com/asteroids-game-python/</id>
      <link href="https://realpython.com/asteroids-game-python/"/>
      <updated>2021-03-22T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll build a clone of the Asteroids game in Python using Pygame. Step by step, you&#x27;ll add images, input handling, game logic, sounds, and text to your program.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Do you want to create your own computer games but like Python too much to abandon it for a career as a game developer? There’s a solution for that! With the Pygame module, you can use your amazing Python skills to create games, from the basic to the very complex. Below, you’ll learn how to use Pygame by making a clone of the Asteroids game!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to build a complete game, including:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Loading &lt;strong&gt;images&lt;/strong&gt; and displaying them on the screen&lt;/li&gt;
&lt;li&gt;Handling &lt;strong&gt;user input&lt;/strong&gt; in order to control the game&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Moving objects&lt;/strong&gt; according to the &lt;strong&gt;game logic&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Detecting &lt;strong&gt;collisions&lt;/strong&gt; between object&lt;/li&gt;
&lt;li&gt;Displaying &lt;strong&gt;text&lt;/strong&gt; on the screen&lt;/li&gt;
&lt;li&gt;Playing &lt;strong&gt;sounds&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Click the link below to download the code for this project and follow along as you build your game:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get the Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-asteroids-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-asteroids-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get the source code you’ll use&lt;/a&gt; to build an Asteroids game in Python with Pygame in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Let’s get started!&lt;/p&gt;
&lt;h2 id=&quot;demo-asteroids-game-in-python&quot;&gt;Demo: Asteroids Game in Python&lt;a class=&quot;headerlink&quot; href=&quot;#demo-asteroids-game-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The game you’ll be making is a clone of the classic arcade game &lt;a href=&quot;https://www.youtube.com/watch?v=WYSupJ5r2zo&quot;&gt;Asteroids&lt;/a&gt;. In it, you control a spaceship and shoot asteroids. If your spaceship collides with an asteroid, you lose. If you shoot down all asteroids, you win!&lt;/p&gt;
&lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 &quot;&gt;
  &lt;iframe class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/511326635?background=1&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;h2 id=&quot;project-overview&quot;&gt;Project Overview&lt;a class=&quot;headerlink&quot; href=&quot;#project-overview&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Your Asteroids game in Python will feature a single spaceship. The spaceship can rotate left and right as well as accelerate forward. When it’s not accelerating, it will continue moving with the velocity it had. The spaceship can also shoot bullets.&lt;/p&gt;
&lt;p&gt;The game will use the following key mappings:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Key&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-arrow-right&quot;&gt;Right&lt;/kbd&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;Rotate the spaceship right&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-arrow-left&quot;&gt;Left&lt;/kbd&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;Rotate the spaceship left&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-arrow-up&quot;&gt;Up&lt;/kbd&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;Accelerate the spaceship forward&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-space&quot;&gt;Space&lt;/kbd&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;Shoot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-escape&quot;&gt;Esc&lt;/kbd&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;Exit the game&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;There will also be six big asteroids in the game. When a bullet hits a big asteroid, it will split into two medium ones. When a bullet hits a medium asteroid, it will split into two small ones. A small asteroid won’t split but will be destroyed by a bullet.&lt;/p&gt;
&lt;p&gt;When an asteroid collides with the spaceship, the spaceship will be destroyed, and the game will end in a defeat. When all asteroids are gone, the game will end in a victory!&lt;/p&gt;
&lt;p&gt;The project will be broken into ten steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Setting up Pygame for a Python project&lt;/li&gt;
&lt;li&gt;Handing input in the game&lt;/li&gt;
&lt;li&gt;Loading images and showing them on the screen&lt;/li&gt;
&lt;li&gt;Creating game objects with an image, a position, and some logic&lt;/li&gt;
&lt;li&gt;Moving the spaceship&lt;/li&gt;
&lt;li&gt;Moving the asteroids and detecting collisions with the spaceship&lt;/li&gt;
&lt;li&gt;Shooting bullets and destroying asteroids&lt;/li&gt;
&lt;li&gt;Splitting asteroids into smaller ones&lt;/li&gt;
&lt;li&gt;Playing sounds&lt;/li&gt;
&lt;li&gt;Handling the end of the game&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Each step will provide links to all necessary resources.&lt;/p&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;headerlink&quot; href=&quot;#prerequisites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To build your Asteroids game, you’ll need some more advanced elements of Python. You should already be comfortable with the language itself as well as with concepts like classes, inheritance, and callbacks. If you need to refresh your knowledge on these topics, then check our &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;Object-Oriented Programming (OOP) in Python 3&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The game will also use &lt;strong&gt;vectors&lt;/strong&gt; to represent positions and directions, as well as some vector operations to move the elements on the screen. Pygame will take care of most of the math, and all the necessary concepts will be explained in this tutorial. However, if you want to know more, then you can check out &lt;a href=&quot;https://www.onlinemathlearning.com/vector-addition.html&quot;&gt;Vector Addition&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.pygame.org/docs/&quot;&gt;Pygame documentation&lt;/a&gt; can be useful if you want to understand some concepts in depth, but you’ll find everything you need to know in this tutorial.&lt;/p&gt;
&lt;h2 id=&quot;step-1-pygame-setup&quot;&gt;Step 1: Pygame Setup&lt;a class=&quot;headerlink&quot; href=&quot;#step-1-pygame-setup&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;At the end of this step, you’ll have a small Python project that uses Pygame. It will display a window with a caption, filled with a blue color. This will be first step toward your Asteroids game. You won’t need any specific game development tools. Your favorite text editor and the command line will be enough.&lt;/p&gt;
&lt;h3 id=&quot;python-project&quot;&gt;Python Project&lt;a class=&quot;headerlink&quot; href=&quot;#python-project&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/asteroids-game-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/asteroids-game-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #52: Connecting to MongoDB and Updates on the Python Packaging Landscape</title>
      <id>https://realpython.com/podcasts/rpp/52/</id>
      <link href="https://realpython.com/podcasts/rpp/52/"/>
      <updated>2021-03-19T12:00:00+00:00</updated>
      <summary>Have you heard about NoSQL databases, or wondered how to use one with Python? How does MongoDB store information and what packages can you use to connect this type of database to your Python project? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you heard about NoSQL databases, or wondered how to use one with Python? How does MongoDB store information and what packages can you use to connect this type of database to your Python project? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Booleans: Leveraging the Values of Truth</title>
      <id>https://realpython.com/courses/booleans-leveraging-truth/</id>
      <link href="https://realpython.com/courses/booleans-leveraging-truth/"/>
      <updated>2021-03-16T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn about the built-in Python Boolean data type, which is used to represent the truth value of an expression. You&#x27;ll see how to use Booleans to compare values, check for identity and membership, and control the flow of your programs with conditionals.</summary>
      <content type="html">
        &lt;p&gt;Understanding how Python Boolean values behave is important to programming well in Python. The &lt;strong&gt;Python Boolean&lt;/strong&gt; type is one of Python&amp;rsquo;s &lt;a href=&quot;https://realpython.com/python-data-types/&quot;&gt;built-in data types&lt;/a&gt;. It&amp;rsquo;s used to represent the truth value of an expression.  For example, the expression &lt;code&gt;1 &amp;lt;= 2&lt;/code&gt; is &lt;code&gt;True&lt;/code&gt;, while the expression &lt;code&gt;0 == 1&lt;/code&gt; is &lt;code&gt;False&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use Python Booleans to write &lt;strong&gt;efficient and readable&lt;/strong&gt; Python code&lt;/li&gt;
&lt;li&gt;Manipulate Boolean values with &lt;strong&gt;Boolean operators&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Convert Booleans to &lt;strong&gt;other types&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Convert other types to &lt;strong&gt;Python Booleans&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #51: Navigating Options for Deploying Your Python Application</title>
      <id>https://realpython.com/podcasts/rpp/51/</id>
      <link href="https://realpython.com/podcasts/rpp/51/"/>
      <updated>2021-03-12T12:00:00+00:00</updated>
      <summary>What goes into the decision of how to host your Python code or application in the cloud? Which technology stack is the right size for your project? This week on the show, we have Calvin Hendryx-Parker. Calvin talks about cloud hosting options, infrastructure choices, and deployment tools.</summary>
      <content type="html">
        &lt;p&gt;What goes into the decision of how to host your Python code or application in the cloud? Which technology stack is the right size for your project? This week on the show, we have Calvin Hendryx-Parker. Calvin talks about cloud hosting options, infrastructure choices, and deployment tools.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Django View Authorization: Restricting Access</title>
      <id>https://realpython.com/courses/django-view-authorization/</id>
      <link href="https://realpython.com/courses/django-view-authorization/"/>
      <updated>2021-03-09T14:00:00+00:00</updated>
      <summary>This course covers how to restrict your web pages to users with different roles through Django view authorization. You&#x27;ll learn about HttpRequest.user objects, view decorators that authenticate, and how to notify your users with the Django messages framework.</summary>
      <content type="html">
        &lt;p&gt;Django provides tools for both authentication and authorization. Django view authorization is typically done with &lt;strong&gt;decorators&lt;/strong&gt;. This course will show you how to use these view decorators to enforce authorized viewing of pages in your Django site.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course you&amp;rsquo;ll know how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;&lt;code&gt;HttpRequest&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;HttpRequest.user&lt;/code&gt;&lt;/strong&gt; objects&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authenticate&lt;/strong&gt; and &lt;strong&gt;authorize&lt;/strong&gt; users&lt;/li&gt;
&lt;li&gt;Differentiate between &lt;strong&gt;regular&lt;/strong&gt;, &lt;strong&gt;staff&lt;/strong&gt;, and &lt;strong&gt;admin&lt;/strong&gt; users&lt;/li&gt;
&lt;li&gt;Secure a view with the &lt;strong&gt;&lt;code&gt;@login_required&lt;/code&gt;&lt;/strong&gt; decorator&lt;/li&gt;
&lt;li&gt;Restrict a view to different roles with the &lt;strong&gt;&lt;code&gt;@user_passes_test&lt;/code&gt;&lt;/strong&gt; decorator&lt;/li&gt;
&lt;li&gt;Use the Django &lt;strong&gt;messages framework&lt;/strong&gt; to notify your users&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #50: Consuming APIs With Python and Building Microservices With gRPC</title>
      <id>https://realpython.com/podcasts/rpp/50/</id>
      <link href="https://realpython.com/podcasts/rpp/50/"/>
      <updated>2021-03-05T12:00:00+00:00</updated>
      <summary>Have you wanted to get your Python code to consume data from web-based APIs? Maybe you&#x27;ve dabbled with the requests package, but you don&#x27;t know what steps to take next. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you wanted to get your Python code to consume data from web-based APIs? Maybe you&#x27;ve dabbled with the requests package, but you don&#x27;t know what steps to take next. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Navigating Namespaces and Scope in Python</title>
      <id>https://realpython.com/courses/navigate-namespaces-scope/</id>
      <link href="https://realpython.com/courses/navigate-namespaces-scope/"/>
      <updated>2021-03-02T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn about Python namespaces, the structures used to store and organize the symbolic names created during execution of a Python program. You&#x27;ll learn when namespaces are created, how they are implemented, and how they define variable scope.</summary>
      <content type="html">
        &lt;p&gt;In a program of any complexity, you&amp;rsquo;ll create hundreds or thousands of names, each pointing to a specific object. How does Python keep track of all these names so that they don&amp;rsquo;t interfere with one another? This course covers Python namespaces, the structures used to organize the symbolic names assigned to objects in a Python program.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How Python organizes symbolic names and objects in &lt;strong&gt;namespaces&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;When Python creates a new namespace&lt;/li&gt;
&lt;li&gt;How namespaces are implemented&lt;/li&gt;
&lt;li&gt;How &lt;strong&gt;variable scope&lt;/strong&gt; determines symbolic name visibility&lt;/li&gt;
&lt;li&gt;What is the &lt;strong&gt;LEGB&lt;/strong&gt; rule&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #49: The Challenges of Developing Into a Python Professional</title>
      <id>https://realpython.com/podcasts/rpp/49/</id>
      <link href="https://realpython.com/podcasts/rpp/49/"/>
      <updated>2021-02-26T12:00:00+00:00</updated>
      <summary>What&#x27;s the difference between writing code for yourself and developing for others? What new  considerations do you need to take into account as a professional Python developer? This week on the show, we talk to Dane Hillard about his book &quot;Practices of the Python Pro&quot;.</summary>
      <content type="html">
        &lt;p&gt;What&#x27;s the difference between writing code for yourself and developing for others? What new  considerations do you need to take into account as a professional Python developer? This week on the show, we talk to Dane Hillard about his book &quot;Practices of the Python Pro&quot;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Dictionaries and Arrays: Selecting the Ideal Data Structure</title>
      <id>https://realpython.com/courses/dicts-arrays-ideal-data-structure/</id>
      <link href="https://realpython.com/courses/dicts-arrays-ideal-data-structure/"/>
      <updated>2021-02-23T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn about two of Python&#x27;s data structures: dictionaries and arrays. You&#x27;ll look at multiple types and classes for both of these and learn which implementations are best for your specific use cases.</summary>
      <content type="html">
        &lt;p&gt;There are a variety of ways of storing and managing data in your Python programs, and the choice of the right data structure will affect the readability of your code, ease of writing, and performance. Python has a wide variety of built-in mechanisms that meet most of your data structure needs.&lt;/p&gt;
&lt;p&gt;This course introduces you to two types of data structures: dictionaries and arrays. There are multiple types and classes for both of these data structures and this course discusses them and provides information on how to choose the ideal one.&lt;/p&gt;
&lt;p&gt;In this course you&amp;rsquo;ll learn about:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What are the &lt;strong&gt;advantages&lt;/strong&gt; of using the built-in &lt;code&gt;dict&lt;/code&gt; type &lt;/li&gt;
&lt;li&gt;What are four &lt;strong&gt;other types&lt;/strong&gt; of dictionaries &lt;/li&gt;
&lt;li&gt;How &lt;code&gt;list&lt;/code&gt; and &lt;code&gt;tuple&lt;/code&gt; types are &lt;strong&gt;arrays&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What are typed arrays and how can they &lt;strong&gt;save memory&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How &lt;strong&gt;strings are arrays&lt;/strong&gt; and what that implies&lt;/li&gt;
&lt;li&gt;What are the different arrays for storing &lt;strong&gt;binary data&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What are the &lt;strong&gt;practical uses&lt;/strong&gt; for the different types&lt;/li&gt;
&lt;li&gt;How to select the &lt;strong&gt;ideal data structure&lt;/strong&gt; for your programs&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #48: Stochastic Gradient Descent and Deploying Your Python Scripts on the Web</title>
      <id>https://realpython.com/podcasts/rpp/48/</id>
      <link href="https://realpython.com/podcasts/rpp/48/"/>
      <updated>2021-02-19T12:00:00+00:00</updated>
      <summary>Do you know the initial steps to get your Python script hosted on the web? You may have built something with Flask, but how would you stand it up so that you can share it with others? This week on the show, we have the previous guest Martin Breuss back on the show. Martin shares his recent article titled, &quot;Python Web Applications: Deploy Your Script as a Flask App&quot;.  David Amos also returns, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Do you know the initial steps to get your Python script hosted on the web? You may have built something with Flask, but how would you stand it up so that you can share it with others? This week on the show, we have the previous guest Martin Breuss back on the show. Martin shares his recent article titled, &quot;Python Web Applications: Deploy Your Script as a Flask App&quot;.  David Amos also returns, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Creating PyQt Layouts for GUI Applications</title>
      <id>https://realpython.com/courses/creating-pyqt-layouts-gui-applications/</id>
      <link href="https://realpython.com/courses/creating-pyqt-layouts-gui-applications/"/>
      <updated>2021-02-16T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you’ll learn how to use PyQt layouts to arrange and manage the graphical components on your GUI applications. With the help of PyQt&#x27;s layout managers, you&#x27;ll be able to create polished and professional GUIs with minimal effort.</summary>
      <content type="html">
        &lt;p&gt;PyQt&amp;rsquo;s &lt;a href=&quot;https://doc.qt.io/qt-5/layout.html&quot;&gt;layout managers&lt;/a&gt; provide a user-friendly and productive way of arranging graphical components, or &lt;strong&gt;widgets&lt;/strong&gt;, on a GUI. Laying out widgets properly will make your &lt;a href=&quot;https://realpython.com/learning-paths/python-gui-programming/&quot;&gt;GUI applications&lt;/a&gt; look polished and professional. Learning to do so efficiently and effectively is a fundamental skill for you to get up and running with GUI application development using Python and PyQt.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What the benefits are of using PyQt&amp;rsquo;s &lt;strong&gt;layout managers&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;How to programmatically &lt;strong&gt;lay out widgets&lt;/strong&gt; on a GUI using PyQt&amp;rsquo;s layout managers &lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;select the right layout manager&lt;/strong&gt; for your GUI application&lt;/li&gt;
&lt;li&gt;How to lay out widgets in &lt;strong&gt;main window&amp;ndash;based&lt;/strong&gt; and &lt;strong&gt;dialog-based&lt;/strong&gt; applications&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a better understanding of how to use layout managers, some previous knowledge of how to create &lt;a href=&quot;https://realpython.com/python-pyqt-gui-calculator/&quot;&gt;PyQt GUI applications&lt;/a&gt; and how to work with &lt;a href=&quot;https://doc.qt.io/qt-5/qwidget.html&quot;&gt;PyQt widgets&lt;/a&gt; would be helpful.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  

</feed>
