<?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>2022-09-30T12:00:00+00:00</updated>
  <id>https://realpython.com/</id>
  <author>
    <name>Real Python</name>
  </author>

  
    <entry>
      <title>The Real Python Podcast – Episode #127: Explaining Access Control Using Python &amp; Cautiously Handling Pickles</title>
      <id>https://realpython.com/podcasts/rpp/127/</id>
      <link href="https://realpython.com/podcasts/rpp/127/"/>
      <updated>2022-09-30T12:00:00+00:00</updated>
      <summary>Have you ever used code to help explain a topic? How can Python scripts be used to understand the intricacies of access control? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you ever used code to help explain a topic? How can Python scripts be used to understand the intricacies of access control? This week on the show, Christopher Trudeau is here, bringing 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>Custom Python Strings: Inheriting From str vs UserString</title>
      <id>https://realpython.com/inherit-python-str/</id>
      <link href="https://realpython.com/inherit-python-str/"/>
      <updated>2022-09-28T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to create custom string-like classes in Python by inheriting from the built-in str class or by subclassing UserString from the collections module.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The Python &lt;strong&gt;&lt;code&gt;str&lt;/code&gt;&lt;/strong&gt; class has many useful features that can help you out when you’re processing &lt;strong&gt;text&lt;/strong&gt; or &lt;strong&gt;strings&lt;/strong&gt; in your code. However, in some situations, all these great features may not be enough for you. You may need to create &lt;strong&gt;custom string-like classes&lt;/strong&gt;. To do this in Python, you can inherit from the built-in &lt;code&gt;str&lt;/code&gt; class directly or subclass &lt;code&gt;UserString&lt;/code&gt;, which lives in the &lt;code&gt;collections&lt;/code&gt; module.&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 custom string-like classes by inheriting from the &lt;strong&gt;built-in &lt;code&gt;str&lt;/code&gt; class&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Build custom string-like classes by subclassing &lt;strong&gt;&lt;code&gt;UserString&lt;/code&gt;&lt;/strong&gt; from the &lt;strong&gt;&lt;code&gt;collections&lt;/code&gt; module&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Decide when to use &lt;code&gt;str&lt;/code&gt; or &lt;code&gt;UserString&lt;/code&gt; to create &lt;strong&gt;custom string-like classes&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Meanwhile, you’ll write a few examples that’ll help you decide whether to use &lt;code&gt;str&lt;/code&gt; or &lt;code&gt;UserString&lt;/code&gt; when you’re creating your custom string classes. Your choice will mostly depend on your specific use case.&lt;/p&gt;
&lt;p&gt;To follow along with this tutorial, it’ll help if you’re familiar with Python’s built-in &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;&lt;code&gt;str&lt;/code&gt;&lt;/a&gt; class and its standard features. You’ll also need to know the basics of &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/inheritance-composition-python/&quot;&gt;inheritance&lt;/a&gt; in Python.&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/inherit-python-str-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-inherit-python-str-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to create custom string-like classes.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;creating-string-like-classes-in-python&quot;&gt;Creating String-Like Classes in Python&lt;a class=&quot;headerlink&quot; href=&quot;#creating-string-like-classes-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The built-in &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;&lt;code&gt;str&lt;/code&gt;&lt;/a&gt; class allows you to create &lt;strong&gt;strings&lt;/strong&gt; in Python. Strings are sequences of characters that you’ll use in many situations, especially when working with textual data. From time to time, the standard functionalities of Python’s &lt;code&gt;str&lt;/code&gt; may be insufficient to fulfill your needs. So, you may want to create custom string-like classes that solve your specific problem.&lt;/p&gt;
&lt;p&gt;You’ll typically find at least two reasons for creating custom string-like classes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Extending&lt;/strong&gt; the regular string by adding new functionality&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modifying&lt;/strong&gt; the standard string’s functionality&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can also face situations in which you need to both extend &lt;em&gt;and&lt;/em&gt; modify the standard functionality of strings at the same time.&lt;/p&gt;
&lt;p&gt;In Python, you’ll commonly use one of the following techniques to create your string-like classes. You can inherit from the Python built-in &lt;a href=&quot;https://docs.python.org/3/library/stdtypes.html#str&quot;&gt;&lt;code&gt;str&lt;/code&gt;&lt;/a&gt; class directly or subclass &lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.UserString&quot;&gt;&lt;code&gt;UserString&lt;/code&gt;&lt;/a&gt; from &lt;a href=&quot;https://realpython.com/python-collections-module/&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt;.&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 &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt;, it’s common practice to use the verbs &lt;strong&gt;inherit&lt;/strong&gt; and &lt;strong&gt;subclass&lt;/strong&gt; interchangeably.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;One relevant feature of Python strings is &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-immutable&quot;&gt;immutability&lt;/a&gt;, which means that you can’t modify them &lt;a href=&quot;https://en.wikipedia.org/wiki/In-place_algorithm&quot;&gt;in place&lt;/a&gt;. So, when selecting the appropriate technique to create your own custom string-like classes, you need to consider whether your desired features will affect immutability or not.&lt;/p&gt;
&lt;p&gt;For example, if you need to modify the current behavior of existing string methods, then you’ll probably be okay subclassing &lt;code&gt;str&lt;/code&gt;. In contrast, if you need to change how strings are created, then inheriting from &lt;code&gt;str&lt;/code&gt; will demand advanced knowledge. You’ll have to override the &lt;a href=&quot;https://realpython.com/python-class-constructor/#object-creation-with-__new__&quot;&gt;&lt;code&gt;.__new__()&lt;/code&gt;&lt;/a&gt; method. In this latter case, inheriting from &lt;code&gt;UserString&lt;/code&gt; may make your life easier because you won’t have to touch &lt;code&gt;.__new__()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In the upcoming sections, you’ll learn the pros and cons of each technique so that you can decide which is the best strategy to use for your specific problem.&lt;/p&gt;
&lt;h2 id=&quot;inheriting-from-pythons-built-in-str-class&quot;&gt;Inheriting From Python’s Built-in &lt;code&gt;str&lt;/code&gt; Class&lt;a class=&quot;headerlink&quot; href=&quot;#inheriting-from-pythons-built-in-str-class&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For a long time, it was impossible to inherit directly from Python types implemented in &lt;a href=&quot;https://realpython.com/c-for-python-programmers/&quot;&gt;C&lt;/a&gt;. Python 2.2 fixed this issue. Now you can &lt;a href=&quot;https://docs.python.org/3/whatsnew/2.2.html#peps-252-and-253-type-and-class-changes&quot;&gt;subclass built-in types&lt;/a&gt;, including &lt;code&gt;str&lt;/code&gt;. This new feature is quite convenient when you need to create custom string-like classes.&lt;/p&gt;
&lt;p&gt;By inheriting from &lt;code&gt;str&lt;/code&gt; directly, you can extend and modify the standard behavior of this built-in class. You can also tweak the &lt;a href=&quot;https://realpython.com/python-class-constructor/#pythons-class-constructors-and-the-instantiation-process&quot;&gt;instantiation process&lt;/a&gt; of your custom string-like classes to perform transformations before new instances are ready.&lt;/p&gt;
&lt;h3 id=&quot;extending-the-strings-standard-behavior&quot;&gt;Extending the String’s Standard Behavior&lt;a class=&quot;headerlink&quot; href=&quot;#extending-the-strings-standard-behavior&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;An example of requiring a custom string-like class is when you need to extend the standard Python strings with new behavior. For example, say that you need a string-like class that implements a new method to count the number of words in the underlying string.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/inherit-python-str/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/inherit-python-str/ »&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>Sneaky REST APIs With Django Ninja</title>
      <id>https://realpython.com/courses/rest-apis-with-django-ninja/</id>
      <link href="https://realpython.com/courses/rest-apis-with-django-ninja/"/>
      <updated>2022-09-27T13:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll learn how to use Django Ninja, a FastAPI-inspired tool for turning Django views in REST API endpoints. With Ninja, you can quickly build API endpoints.</summary>
      <content type="html">
        &lt;p&gt;Many web projects have moved to the single-page application model. To use this model with Django, you build a project where Django is the back end accessed through a REST API. The &lt;a href=&quot;https://django-ninja.rest-framework.com/&quot;&gt;Django Ninja&lt;/a&gt; library is a FastAPI-inspired tool kit for turning Django views into REST API endpoints with very little extra code. Along the way, you&amp;rsquo;ll be using &lt;a href=&quot;https://curl.se/&quot;&gt;&lt;code&gt;curl&lt;/code&gt;&lt;/a&gt;, a command-line tool that allows you to grab the contents of a web page. &lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;d like to quickly build API endpoints and learn the ways of the Ninja, you&amp;rsquo;re in the right place.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn about:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;REST APIs&lt;/li&gt;
&lt;li&gt;Django Ninja&lt;/li&gt;
&lt;li&gt;URL arguments and query strings&lt;/li&gt;
&lt;li&gt;Serialization through &lt;code&gt;Schema&lt;/code&gt; and &lt;code&gt;ModelSchema&lt;/code&gt; classes&lt;/li&gt;
&lt;li&gt;CRUD operations&lt;/li&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Error management&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>How to Add Python to PATH</title>
      <id>https://realpython.com/add-python-to-path/</id>
      <link href="https://realpython.com/add-python-to-path/"/>
      <updated>2022-09-26T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn about how to add Python, or any other program, to your PATH environment variable. You&#x27;ll be covering the procedure in Windows, macOS, and Linux and find out what PATH is and why it&#x27;s important.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;You may need to add Python to &lt;code&gt;PATH&lt;/code&gt; if you’ve installed Python, but typing &lt;code&gt;python&lt;/code&gt; on the command line doesn’t seem to work. You may be getting a message saying that the term &lt;code&gt;python&lt;/code&gt; isn’t recognized, or you may end up with the wrong version of Python running.&lt;/p&gt;
&lt;p&gt;A common fix for these problems is adding Python to the &lt;code&gt;PATH&lt;/code&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Environment_variable&quot;&gt;environment variable&lt;/a&gt;. In this tutorial, you’ll learn how to add Python to &lt;code&gt;PATH&lt;/code&gt;. You’ll also learn about what &lt;code&gt;PATH&lt;/code&gt; is and why &lt;code&gt;PATH&lt;/code&gt; is vital for programs like the command line to be able to find your Python installation.&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; A &lt;a href=&quot;https://en.wikipedia.org/wiki/Path_(computing)&quot;&gt;path&lt;/a&gt; is the address of a file or folder on your hard drive. The &lt;code&gt;PATH&lt;/code&gt; environment variable, also referred to as just &lt;code&gt;PATH&lt;/code&gt; or &lt;em&gt;Path&lt;/em&gt;, is a list of paths to directories that your operating system keeps and uses to find executable scripts and programs.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The steps that you’ll need to take to add something to &lt;code&gt;PATH&lt;/code&gt; will depend significantly on your operating system (OS), so be sure to skip to the relevant section if you’re only interested in this procedure for one OS.&lt;/p&gt;
&lt;p&gt;Note that you can use the following steps to add any program to &lt;code&gt;PATH&lt;/code&gt;, not just Python.&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;Supplemental Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/add-python-to-path-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-add-python-to-path-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download free supplemental code&lt;/a&gt; that’ll walk you through changing PATH across operating systems.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;how-to-add-python-to-path-on-windows&quot;&gt;How to Add Python to &lt;code&gt;PATH&lt;/code&gt; on Windows&lt;a class=&quot;headerlink&quot; href=&quot;#how-to-add-python-to-path-on-windows&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first step is to locate the directory in which your target Python executable lives. The path to the directory is what you’ll be adding to the &lt;code&gt;PATH&lt;/code&gt; environment variable.&lt;/p&gt;
&lt;p&gt;To find the Python executable, you’ll need to look for a file called &lt;code&gt;python.exe&lt;/code&gt;. The Python executable could be in a directory in &lt;code&gt;C:\Python\&lt;/code&gt; or in your &lt;code&gt;AppData\&lt;/code&gt; folder, for instance. If the executable were in &lt;code&gt;AppData\&lt;/code&gt;, then the path would typically look something like this:&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;go&quot;&gt;C:\Users\&amp;lt;USER&amp;gt;\AppData\Local\Programs\Python&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In your case, the &lt;code&gt;&amp;lt;USER&amp;gt;&lt;/code&gt; part would be replaced by your currently logged-in user name.&lt;/p&gt;
&lt;p&gt;Once you’ve found the executable, make sure it works by double-clicking it and verifying that it starts up a Python REPL in a new window.&lt;/p&gt;
&lt;p&gt;If you’re struggling to find the right executable, you can use Windows Explorer’s search feature. The issue with the built-in search is that it’s painfully slow. To perform a super-fast full system search for any file, a great alternative is &lt;a href=&quot;https://www.voidtools.com/&quot;&gt;Everything&lt;/a&gt;:&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/which_python_exe.b88dfad1cfb4.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/which_python_exe.b88dfad1cfb4.png&quot; width=&quot;1273&quot; height=&quot;420&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/which_python_exe.b88dfad1cfb4.png&amp;amp;w=318&amp;amp;sig=92146b5f86dae34d90cc97e8ca1c3000b57cb9b8 318w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/which_python_exe.b88dfad1cfb4.png&amp;amp;w=636&amp;amp;sig=03b497308eeb0448413e51a1f3f104af95c108bb 636w, https://files.realpython.com/media/which_python_exe.b88dfad1cfb4.png 1273w&quot; sizes=&quot;75vw&quot; alt=&#x27;A screenshot of the Everything program searching for &quot;python.exe&quot;&#x27; data-asset=&quot;4592&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Those paths highlighted in yellow, namely those at &lt;code&gt;\WindowsApps&lt;/code&gt; and &lt;code&gt;\Python310&lt;/code&gt;, would be ideal candidates to add to &lt;code&gt;PATH&lt;/code&gt; because they look like executables at the root level of an installation. Those highlighted in red wouldn’t be suitable because some are part of a virtual environment—you can see &lt;code&gt;venv&lt;/code&gt; in the path—and some are shortcuts or internal Windows installations.&lt;/p&gt;
&lt;p&gt;You may also encounter Python executables that are installed within the folder for a different program. This is due to the fact that many applications bundle their own version of Python within them. These bundled Python installations would also be unsuitable.&lt;/p&gt;
&lt;p&gt;Once you’ve located your Python executable, open the Start menu and search for the &lt;em&gt;Edit the system environment variables&lt;/em&gt; entry, which opens up a &lt;em&gt;System Properties&lt;/em&gt; window. In the &lt;em&gt;Advanced&lt;/em&gt; tab, click on the button &lt;em&gt;Environment Variables&lt;/em&gt;. There you’ll see &lt;em&gt;User&lt;/em&gt; and &lt;em&gt;System&lt;/em&gt; variables, which you’ll be able to edit:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 &quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/729132627&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/figure&gt;

&lt;p&gt;In the section entitled &lt;em&gt;User Variables&lt;/em&gt;, double-click on the entry that says &lt;em&gt;Path&lt;/em&gt;. Another window will pop up showing a list of paths. Click the &lt;em&gt;New&lt;/em&gt; button and paste the path to your Python executable there. Once that’s inserted, select your newly added path and click the &lt;em&gt;Move Up&lt;/em&gt; button until it’s at the top.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/add-python-to-path/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/add-python-to-path/ »&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 #126: Python as an Efficiency Tool for Non-Developers</title>
      <id>https://realpython.com/podcasts/rpp/126/</id>
      <link href="https://realpython.com/podcasts/rpp/126/"/>
      <updated>2022-09-23T12:00:00+00:00</updated>
      <summary>Are you interested in using Python in an industry outside of software development? Would adding a few custom software tools increase efficiency and make your coworkers&#x27; jobs easier? This week on the show, Josh Burnett talks about using Python as a mechanical engineer.</summary>
      <content type="html">
        &lt;p&gt;Are you interested in using Python in an industry outside of software development? Would adding a few custom software tools increase efficiency and make your coworkers&#x27; jobs easier? This week on the show, Josh Burnett talks about using Python as a mechanical engineer.&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>What Does if __name__ == &quot;__main__&quot; Do in Python?</title>
      <id>https://realpython.com/if-name-main-python/</id>
      <link href="https://realpython.com/if-name-main-python/"/>
      <updated>2022-09-21T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn all about Python&#x27;s name-main idiom. You&#x27;ll learn what it does in Python, how it works, when to use it, when to avoid it, and how to refer to it.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;You’ve likely encountered Python’s &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; idiom when reading other people’s code. No wonder—&lt;a href=&quot;https://github.com/search?q=__name__+%3D%3D+%22__main__%22&amp;amp;type=code&quot;&gt;it’s widespread&lt;/a&gt;! You might have even used &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; in your own scripts. But did you use it correctly?&lt;/p&gt;
&lt;p&gt;Maybe you’ve programmed in a &lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_C-family_programming_languages&quot;&gt;C-family language&lt;/a&gt; like &lt;a href=&quot;https://realpython.com/java-vs-python/&quot;&gt;Java&lt;/a&gt; before, and you wonder whether this construct is a clumsy accessory to using a &lt;code&gt;main()&lt;/code&gt; function as an &lt;a href=&quot;https://en.wikipedia.org/wiki/Entry_point#Contemporary&quot;&gt;entry point&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Syntactically, Python’s &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; idiom is just a normal &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;conditional block&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;linenos&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;vm&quot;&gt;__name__&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;__main__&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 2&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The indented block starting in line 2 contains all the code that Python will execute when the conditional statement in line 1 evaluates to &lt;code&gt;True&lt;/code&gt;. In the code example above, the specific code logic that you’d put in the conditional block is represented with a placeholder &lt;a href=&quot;https://realpython.com/python-ellipsis/&quot;&gt;ellipsis&lt;/a&gt; (&lt;code&gt;...&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;So—if there’s nothing special about the &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; idiom, then why does it &lt;em&gt;look&lt;/em&gt; confusing, and why does it continue to spark discussion in the Python community?&lt;/p&gt;
&lt;p&gt;If the idiom still seems a little cryptic, and you’re not completely sure &lt;strong&gt;what&lt;/strong&gt; it does, &lt;strong&gt;why&lt;/strong&gt; you might want it, and &lt;strong&gt;when&lt;/strong&gt; to use it, then you’ve come to the right place! In this tutorial, you’ll learn all about Python’s &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; idiom—starting with what it really does in Python, and ending with a suggestion for a quicker way to refer to it.&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;Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/if-name-main-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-if-name-main-python-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free source code&lt;/a&gt; that you’ll use to understand the name-main idiom.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;in-short-it-allows-you-to-execute-code-when-the-file-runs-as-a-script-but-not-when-its-imported-as-a-module&quot;&gt;In Short: It Allows You to Execute Code When the File Runs as a Script, but Not When It’s Imported as a Module&lt;a class=&quot;headerlink&quot; href=&quot;#in-short-it-allows-you-to-execute-code-when-the-file-runs-as-a-script-but-not-when-its-imported-as-a-module&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For most practical purposes, you can think of the conditional block that you open with &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; as a way to store code that should only run when your file is executed as a script.&lt;/p&gt;
&lt;p&gt;You’ll see what that means in a moment. For now, say you have the following file:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;linenos&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# echo.py&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 2&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 3&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;repetitions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 4&lt;/span&gt;    &lt;span class=&quot;sd&quot;&gt;&quot;&quot;&quot;Imitate a real-world echo.&quot;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 5&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;echoed_text&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 6&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;repetitions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 7&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;echoed_text&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:]&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 8&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;echoed_text&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lower&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&quot;&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 9&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;vm&quot;&gt;__name__&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;__main__&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt;11&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Yell something at a mountain: &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt;12&lt;/span&gt;    &lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this example, you define a function, &lt;code&gt;echo()&lt;/code&gt;, that mimics a real-world echo by gradually printing fewer and fewer of the final letters of the input text.&lt;/p&gt;
&lt;p&gt;Below that, in lines 10 to 12, you use the &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; idiom. This code starts with the conditional statement &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; in line 10. In the indented lines, 11 and 12, you then collect user input and call &lt;code&gt;echo()&lt;/code&gt; with that input. These two lines will execute when you run &lt;code&gt;echo.py&lt;/code&gt; as a script from your command line:&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;python echo.py
&lt;span class=&quot;go&quot;&gt;Yell something at a mountain: HELLOOOO ECHOOOOOOOOOO&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ooo&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;oo&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;o&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When you run the file as a script by passing the file object to your Python interpreter, the expression &lt;code&gt;__name__ == &quot;__main__&quot;&lt;/code&gt; returns &lt;code&gt;True&lt;/code&gt;. The code block under &lt;code&gt;if&lt;/code&gt; then runs, so Python collects user input and calls &lt;code&gt;echo()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Try it out yourself! You can download all the code files that you’ll use in this tutorial from 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;Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/if-name-main-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-if-name-main-python-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free source code&lt;/a&gt; that you’ll use to understand the name-main idiom.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;At the same time, if you import &lt;code&gt;echo()&lt;/code&gt; in another module or a console session, then the nested code won’t run:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;echo&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Please help me I&#x27;m stuck on a mountain&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ain&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;in&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;n&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this case, you want to use &lt;code&gt;echo()&lt;/code&gt; in the context of another script or interpreter session, so you won’t need to collect user input. Running &lt;code&gt;input()&lt;/code&gt; would mess with your code by producing a side effect when importing &lt;code&gt;echo&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When you nest the code that’s specific to the script usage of your file under the &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; idiom, then you avoid running code that’s irrelevant for imported modules.&lt;/p&gt;
&lt;p&gt;Nesting code under &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; allows you to cater to different use cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Script:&lt;/strong&gt; When run as a script, your code prompts the user for input, calls &lt;code&gt;echo()&lt;/code&gt;, and prints the result.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Module:&lt;/strong&gt; When you import &lt;code&gt;echo&lt;/code&gt; as a module, then &lt;code&gt;echo()&lt;/code&gt; gets defined, but no code executes. You provide &lt;code&gt;echo()&lt;/code&gt; to the main code session without any side effects.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By implementing the &lt;code&gt;if __name__ == &quot;__main__&quot;&lt;/code&gt; idiom in your code, you set up an additional entry point that allows you to use &lt;code&gt;echo()&lt;/code&gt; right from the command line.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/if-name-main-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/if-name-main-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>Building Python Project Documentation With MkDocs</title>
      <id>https://realpython.com/courses/building-project-documentation-mkdocs/</id>
      <link href="https://realpython.com/courses/building-project-documentation-mkdocs/"/>
      <updated>2022-09-20T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll learn how to build professional documentation for a Python package using MkDocs and mkdocstrings. These tools allow you to generate nice-looking and modern documentation from Markdown files and, more importantly, from your code&#x27;s docstrings.</summary>
      <content type="html">
        &lt;p&gt;In this course, you&amp;rsquo;ll learn how to quickly build &lt;strong&gt;documentation&lt;/strong&gt; for a Python package using &lt;strong&gt;MkDocs&lt;/strong&gt; and &lt;strong&gt;mkdocstrings&lt;/strong&gt;. These tools allow you to generate nice-looking and modern documentation from &lt;strong&gt;Markdown&lt;/strong&gt; files and your code&amp;rsquo;s &lt;strong&gt;docstrings&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Maintaining &lt;strong&gt;auto-generated documentation&lt;/strong&gt; means less effort because you&amp;rsquo;re linking information between your code and the documentation pages. However, good documentation is &lt;em&gt;more&lt;/em&gt; than just the technical description pulled from your code! Your project will appeal more to users if you guide them through examples and connect the dots between the docstrings.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Material for MkDocs theme&lt;/strong&gt; makes your documentation &lt;strong&gt;look good&lt;/strong&gt; without any extra effort and is used by popular projects such as &lt;a href=&quot;https://typer.tiangolo.com&quot;&gt;Typer CLI&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/fastapi-python-web-apis/&quot;&gt;FastAPI&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Work with &lt;strong&gt;MkDocs&lt;/strong&gt; to produce &lt;strong&gt;static pages from Markdown&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Pull in &lt;strong&gt;code documentation from docstrings&lt;/strong&gt; using &lt;strong&gt;mkdocstrings&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Follow &lt;strong&gt;best practices&lt;/strong&gt; for project documentation&lt;/li&gt;
&lt;li&gt;Use the &lt;strong&gt;Material for MkDocs theme&lt;/strong&gt; to make your documentation look good&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Host&lt;/strong&gt; your documentation on &lt;strong&gt;GitHub Pages&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>When Do You Use an Ellipsis in Python?</title>
      <id>https://realpython.com/python-ellipsis/</id>
      <link href="https://realpython.com/python-ellipsis/"/>
      <updated>2022-09-19T14:00:00+00:00</updated>
      <summary>You may have seen three dots in Python scripts. Although this syntax may look odd,  using an ellipsis is valid Python code. In this tutorial, you&#x27;ll learn when Python&#x27;s Ellipsis constant can come in handy for you.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In English writing, you can use the &lt;a href=&quot;https://en.wikipedia.org/wiki/Ellipsis&quot;&gt;ellipsis&lt;/a&gt; to indicate that you’re leaving something out.
Essentially, you use three dots (&lt;code&gt;...&lt;/code&gt;) to replace the content.
But the ellipsis doesn’t only exist in prose—you may have seen three dots in Python source code, too.&lt;/p&gt;
&lt;p&gt;The ellipsis literal (&lt;code&gt;...&lt;/code&gt;) evaluates to Python’s &lt;strong&gt;&lt;code&gt;Ellipsis&lt;/code&gt;&lt;/strong&gt;.
Because &lt;a href=&quot;https://docs.python.org/3/library/constants.html#Ellipsis&quot;&gt;&lt;code&gt;Ellipsis&lt;/code&gt;&lt;/a&gt; is a built-in &lt;a href=&quot;https://realpython.com/python-constants/&quot;&gt;constant&lt;/a&gt;,
you can use &lt;code&gt;Ellipsis&lt;/code&gt; or &lt;code&gt;...&lt;/code&gt; without &lt;a href=&quot;https://realpython.com/python-import/&quot;&gt;importing&lt;/a&gt; it:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Ellipsis&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;Ellipsis&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Ellipsis&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;...&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;Ellipsis&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Although three dots may look odd as Python syntax, there are situations where using &lt;code&gt;...&lt;/code&gt; can come in handy.
&lt;strong&gt;But when should you use &lt;code&gt;Ellipsis&lt;/code&gt; in Python?&lt;/strong&gt;&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;Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-ellipsis-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-ellipsis-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free source code&lt;/a&gt; that you’ll use to master the ellipsis literal.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;in-short-use-the-ellipsis-as-a-placeholder-in-python&quot;&gt;In Short: Use the Ellipsis as a Placeholder in Python&lt;a class=&quot;headerlink&quot; href=&quot;#in-short-use-the-ellipsis-as-a-placeholder-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;While you can use &lt;code&gt;...&lt;/code&gt; and &lt;code&gt;Ellipsis&lt;/code&gt; interchangeably, you’ll commonly opt for &lt;code&gt;...&lt;/code&gt; in your code.
Similar to using three dots in English to omit content, you can use the ellipsis in Python as a placeholder for unwritten code:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# ellipsis_example.py&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;do_nothing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;do_nothing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When you run &lt;code&gt;ellipsis_example.py&lt;/code&gt; and execute &lt;code&gt;do_nothing()&lt;/code&gt;, then Python runs without complaining:&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;python ellipsis_example.py
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There’s no error when you execute a function in Python that contains only &lt;code&gt;...&lt;/code&gt; in the function body.
That means you can use an ellipsis as a placeholder similar to the &lt;a href=&quot;https://realpython.com/python-pass/&quot;&gt;&lt;code&gt;pass&lt;/code&gt; keyword&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Using three dots creates minimal visual clutter.
So, it can be convenient to replace irrelevant code when you’re sharing parts of your code online.&lt;/p&gt;
&lt;p&gt;A common time when you omit code is when you work with &lt;strong&gt;stubs&lt;/strong&gt;.
You can think of stubs as stand-ins for real functions.
Stubs can come in handy when you only need a function signature but don’t want to execute the code in the function body.
For example, you’d probably want to prevent external requests when you’re developing an application.&lt;/p&gt;
&lt;p&gt;Say you have a &lt;a href=&quot;https://realpython.com/flask-blueprint/&quot;&gt;Flask project&lt;/a&gt; where you’ve created your own visitor counter in &lt;code&gt;custom_stats.count_visitor()&lt;/code&gt;.
The &lt;code&gt;count_visitor()&lt;/code&gt; function is connected to the database where you track the number of visitors.
To not count yourself when you test your application in debug mode, you can create a stub of &lt;code&gt;count_visitor()&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;linenos&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# app.py&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 2&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 3&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;flask&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Flask&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 4&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 5&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;custom_stats&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;count_visitor&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 6&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 7&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Flask&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;vm&quot;&gt;__name__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 8&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 9&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;hll&quot;&gt;&lt;span class=&quot;linenos&quot;&gt;10&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;count_visitor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;linenos&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;@app&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;route&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;home&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt;14&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;count_visitor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt;15&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hello, world!&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Because the content of &lt;code&gt;count_visitor()&lt;/code&gt; doesn’t matter in this case, it’s a good idea to use the ellipsis in the function body.
Python calls &lt;code&gt;count_visitor()&lt;/code&gt; without error or unwanted side effects when you run your Flask application in debug mode:&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;flask --app app --debug run
&lt;span class=&quot;go&quot;&gt; * Serving Flask app &#x27;app&#x27;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; * Debug mode: on&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-ellipsis/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-ellipsis/ »&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 #125: Improve Matplotlib With Style Sheets &amp; Python Async for the Web</title>
      <id>https://realpython.com/podcasts/rpp/125/</id>
      <link href="https://realpython.com/podcasts/rpp/125/"/>
      <updated>2022-09-16T12:00:00+00:00</updated>
      <summary>Have you thought the standard output from Matplotlib is a bit generic looking? Would you like a quick way to add style and consistency to your data visualizations? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you thought the standard output from Matplotlib is a bit generic looking? Would you like a quick way to add style and consistency to your data visualizations? This week on the show, Christopher Trudeau is here, bringing 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>How to Replace a String in Python</title>
      <id>https://realpython.com/replace-string-python/</id>
      <link href="https://realpython.com/replace-string-python/"/>
      <updated>2022-09-14T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to remove or replace a string or substring. You&#x27;ll go from the basic string method .replace() all the way up to a multi-layer regex pattern using the sub() function from Python&#x27;s re module.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you’re looking for ways to remove or replace all or part of a &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;string&lt;/a&gt; in Python, then this tutorial is for you. You’ll be taking a fictional chat room transcript and &lt;a href=&quot;https://en.wikipedia.org/wiki/Sanitization_(classified_information)&quot;&gt;sanitizing&lt;/a&gt; it using both the &lt;strong&gt;&lt;code&gt;.replace()&lt;/code&gt; method&lt;/strong&gt; and the &lt;strong&gt;&lt;code&gt;re.sub()&lt;/code&gt; function&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In Python, the &lt;code&gt;.replace()&lt;/code&gt; method and the &lt;code&gt;re.sub()&lt;/code&gt; function are often used to clean up text by removing strings or substrings or replacing them. In this tutorial, you’ll be playing the role of a developer for a company that provides technical support through a one-to-one text chat. You’re tasked with creating a script that’ll sanitize the chat, removing any &lt;a href=&quot;https://en.wikipedia.org/wiki/Personal_data&quot;&gt;personal data&lt;/a&gt; and replacing any swear words with emoji.&lt;/p&gt;
&lt;p&gt;You’re only given one very short chat transcript:&lt;/p&gt;
&lt;div class=&quot;highlight text&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;[support_tom] 2022-08-24T10:02:23+00:00 : What can I help you with?
[johndoe] 2022-08-24T10:03:15+00:00 : I CAN&#x27;T CONNECT TO MY BLASTED ACCOUNT
[support_tom] 2022-08-24T10:03:30+00:00 : Are you sure it&#x27;s not your caps lock?
[johndoe] 2022-08-24T10:04:03+00:00 : Blast! You&#x27;re right!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Even though this transcript is short, it’s typical of the type of chats that agents have all the time. It has user identifiers, &lt;a href=&quot;https://en.wikipedia.org/wiki/ISO_8601&quot;&gt;ISO time stamps&lt;/a&gt;, and messages.&lt;/p&gt;
&lt;p&gt;In this case, the client &lt;code&gt;johndoe&lt;/code&gt; filed a complaint, and company policy is to sanitize and simplify the transcript, then pass it on for independent evaluation. Sanitizing the message is your job!&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/replace-string-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-replace-string-python-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free sample code&lt;/a&gt; that you’ll use to replace strings in Python.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The first thing you’ll want to do is to take care of any swear words.&lt;/p&gt;
&lt;h2 id=&quot;how-to-remove-or-replace-a-python-string-or-substring&quot;&gt;How to Remove or Replace a Python String or Substring&lt;a class=&quot;headerlink&quot; href=&quot;#how-to-remove-or-replace-a-python-string-or-substring&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The most basic way to replace a string in Python is to use the &lt;code&gt;.replace()&lt;/code&gt; string method:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Fake Python&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Fake&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Real&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Real Python&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, you can chain &lt;code&gt;.replace()&lt;/code&gt; onto any string and provide the method with two arguments. The first is the string that you want to replace, and the second is the replacement.&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; Although the Python shell displays the result of &lt;code&gt;.replace()&lt;/code&gt;, the string itself stays unchanged. You can see this more clearly by assigning your string to a variable:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Fake Python&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Fake&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Real&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Real Python&#x27;&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Fake Python&#x27;&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Fake&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Real&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Real Python&#x27;&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Real Python&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Notice that when you simply call &lt;code&gt;.replace()&lt;/code&gt;, the value of &lt;code&gt;name&lt;/code&gt; doesn’t change. But when you assign the result of &lt;code&gt;name.replace()&lt;/code&gt; to the &lt;code&gt;name&lt;/code&gt; variable, &lt;code&gt;&#x27;Fake Python&#x27;&lt;/code&gt; becomes &lt;code&gt;&#x27;Real Python&#x27;&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Now it’s time to apply this knowledge to the transcript:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;transcript&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[support_tom] 2022-08-24T10:02:23+00:00 : What can I help you with?&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[johndoe] 2022-08-24T10:03:15+00:00 : I CAN&#x27;T CONNECT TO MY BLASTED ACCOUNT&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[support_tom] 2022-08-24T10:03:30+00:00 : Are you sure it&#x27;s not your caps lock?&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[johndoe] 2022-08-24T10:04:03+00:00 : Blast! You&#x27;re right!&quot;&quot;&quot;&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;transcript&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;BLASTED&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;😤&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[support_tom] 2022-08-24T10:02:23+00:00 : What can I help you with?&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[johndoe] 2022-08-24T10:03:15+00:00 : I CAN&#x27;T CONNECT TO MY 😤 ACCOUNT&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[support_tom] 2022-08-24T10:03:30+00:00 : Are you sure it&#x27;s not your caps lock?&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[johndoe] 2022-08-24T10:04:03+00:00 : Blast! You&#x27;re right!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Loading the transcript as a &lt;a href=&quot;https://realpython.com/python-data-types/#triple-quoted-strings&quot;&gt;triple-quoted string&lt;/a&gt; and then using the &lt;code&gt;.replace()&lt;/code&gt; method on one of the swear words works fine. But there’s another swear word that’s not getting replaced because in Python, the string needs to match &lt;em&gt;exactly&lt;/em&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Fake Python&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;fake&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Real&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;Fake Python&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;As you can see, even if the casing of one letter doesn’t match, it’ll prevent any replacements. This means that if you’re using the &lt;code&gt;.replace()&lt;/code&gt; method, you’ll need to call it various times with the variations. In this case, you can just chain on another call to &lt;code&gt;.replace()&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;transcript&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;BLASTED&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;😤&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Blast&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;😤&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[support_tom] 2022-08-24T10:02:23+00:00 : What can I help you with?&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[johndoe] 2022-08-24T10:03:15+00:00 : I CAN&#x27;T CONNECT TO MY 😤 ACCOUNT&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[support_tom] 2022-08-24T10:03:30+00:00 : Are you sure it&#x27;s not your caps lock?&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[johndoe] 2022-08-24T10:04:03+00:00 : 😤! You&#x27;re right!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Success! But you’re probably thinking that this isn’t the best way to do this for something like a general-purpose transcription sanitizer. You’ll want to move toward some way of having a list of replacements, instead of having to type out &lt;code&gt;.replace()&lt;/code&gt; each time.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/replace-string-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/replace-string-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 Basics: Conditional Logic &amp; Control Flow</title>
      <id>https://realpython.com/courses/basics-conditional-logic-control-flow/</id>
      <link href="https://realpython.com/courses/basics-conditional-logic-control-flow/"/>
      <updated>2022-09-13T14:00:00+00:00</updated>
      <summary>In this Python Basics video course, you&#x27;ll learn how use conditional logic to write programs that perform different actions based on different conditions. Paired with functions and loops, conditional logic allows you to write complex programs that can handle many different situations.</summary>
      <content type="html">
        &lt;p&gt;Much of the Python code you&amp;rsquo;ll write is unconditional. That is, the code does not make any choices. Every line of code is executed in the order that it&amp;rsquo;s written or in the order that functions are called, with possible repetitions inside loops.&lt;/p&gt;
&lt;p&gt;In this course, you&amp;rsquo;ll learn how to use conditional logic to write programs that perform different actions based on different conditions. Paired with functions and loops, conditional logic allows you to write complex programs that can handle many different situations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this Python Basics video course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compare the values of two or more variables&lt;/li&gt;
&lt;li&gt;Write &lt;code&gt;if&lt;/code&gt; statements to control the flow of your programs &lt;/li&gt;
&lt;li&gt;Handle errors with &lt;code&gt;try&lt;/code&gt; and &lt;code&gt;except&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Apply conditional logic to create simulations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. You can also check out the other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course.&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>Custom Python Lists: Inheriting From list vs UserList</title>
      <id>https://realpython.com/inherit-python-list/</id>
      <link href="https://realpython.com/inherit-python-list/"/>
      <updated>2022-09-12T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to create custom list-like classes in Python by inheriting from the built-in list class or by subclassing UserList from the collections module.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;At some point in your Python coding adventure, you may need to create &lt;strong&gt;custom list-like classes&lt;/strong&gt; with modified behavior, new functionalities, or both. To do this in Python, you can inherit from an &lt;a href=&quot;https://docs.python.org/3/library/collections.abc.html#module-collections.abc&quot;&gt;abstract base class&lt;/a&gt;, subclass the built-in &lt;code&gt;list&lt;/code&gt; class directly, or inherit from &lt;code&gt;UserList&lt;/code&gt;, which lives in the &lt;code&gt;collections&lt;/code&gt; module.&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 custom list-like classes by inheriting from the &lt;strong&gt;built-in &lt;code&gt;list&lt;/code&gt; class&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Build custom list-like classes by subclassing &lt;strong&gt;&lt;code&gt;UserList&lt;/code&gt;&lt;/strong&gt; from the &lt;strong&gt;&lt;code&gt;collections&lt;/code&gt; module&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll also write some examples that’ll help you decide which parent class, &lt;code&gt;list&lt;/code&gt; or &lt;code&gt;UserList&lt;/code&gt;, to use when creating your custom list classes.&lt;/p&gt;
&lt;p&gt;To get the most out of this tutorial, you should be familiar with Python’s built-in &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;&lt;code&gt;list&lt;/code&gt;&lt;/a&gt; class and its standard features. You’ll also need to know the basics of &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt; and understand how &lt;a href=&quot;https://realpython.com/inheritance-composition-python/&quot;&gt;inheritance&lt;/a&gt; works in Python.&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 Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/inherit-python-list-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-inherit-python-list-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the source code&lt;/a&gt; that you’ll use to create custom list-like classes.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;creating-list-like-classes-in-python&quot;&gt;Creating List-Like Classes in Python&lt;a class=&quot;headerlink&quot; href=&quot;#creating-list-like-classes-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The built-in &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;&lt;code&gt;list&lt;/code&gt;&lt;/a&gt; class is a fundamental data type in Python. Lists are useful in many situations and have tons of practical use cases. In some of these use cases, the standard functionality of Python &lt;code&gt;list&lt;/code&gt; may be insufficient, and you may need to create custom list-like classes to address the problem at hand.&lt;/p&gt;
&lt;p&gt;You’ll typically find at least two reasons for creating custom list-like classes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Extending&lt;/strong&gt; the regular list by adding new functionality&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modifying&lt;/strong&gt; the standard list’s functionality&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can also face situations in which you need to both extend &lt;em&gt;and&lt;/em&gt; modify the list’s standard functionality.&lt;/p&gt;
&lt;p&gt;Depending on your specific needs and skill level, you can use a few strategies to create your own custom list-like classes. You can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Inherit from an appropriate abstract base class, such as &lt;a href=&quot;https://docs.python.org/3/library/collections.abc.html#collections.abc.MutableSequence&quot;&gt;&lt;code&gt;MutableSequence&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Inherit from the Python built-in &lt;a href=&quot;https://docs.python.org/3/library/stdtypes.html#list&quot;&gt;&lt;code&gt;list&lt;/code&gt;&lt;/a&gt; class directly&lt;/li&gt;
&lt;li&gt;Subclass &lt;a href=&quot;https://docs.python.org/3/library/collections.html#collections.UserList&quot;&gt;&lt;code&gt;UserList&lt;/code&gt;&lt;/a&gt; from &lt;a href=&quot;https://realpython.com/python-collections-module/&quot;&gt;&lt;code&gt;collections&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&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 &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt;, it’s common practice to use the verbs &lt;strong&gt;inherit&lt;/strong&gt; and &lt;strong&gt;subclass&lt;/strong&gt; interchangeably.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;There are a few considerations when you’re selecting the appropriate strategy to use. Keep reading for more details.&lt;/p&gt;
&lt;h2 id=&quot;building-a-list-like-class-from-an-abstract-base-class&quot;&gt;Building a List-Like Class From an Abstract Base Class&lt;a class=&quot;headerlink&quot; href=&quot;#building-a-list-like-class-from-an-abstract-base-class&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You can create your own list-like classes by inheriting from an appropriate &lt;strong&gt;abstract base class (ABC)&lt;/strong&gt;, like &lt;a href=&quot;https://docs.python.org/3/library/collections.abc.html#collections.abc.MutableSequence&quot;&gt;&lt;code&gt;MutableSequence&lt;/code&gt;&lt;/a&gt;. This ABC provides generic implementations of most &lt;code&gt;list&lt;/code&gt; methods except for &lt;a href=&quot;https://docs.python.org/3/reference/datamodel.html#object.__getitem__&quot;&gt;&lt;code&gt;.__getitem__()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/reference/datamodel.html#object.__setitem__&quot;&gt;&lt;code&gt;.__setitem__()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/reference/datamodel.html#object.__delitem__&quot;&gt;&lt;code&gt;.__delitem__&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/reference/datamodel.html#object.__len__&quot;&gt;&lt;code&gt;.__len__()&lt;/code&gt;&lt;/a&gt;, and &lt;code&gt;.insert()&lt;/code&gt;. So, when inheriting from this class, you’ll have to implement these methods yourself.&lt;/p&gt;
&lt;p&gt;Writing your own implementation for all these &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-special-method&quot;&gt;special methods&lt;/a&gt; is a fair amount of work. It’s error-prone and requires advanced knowledge of Python and its &lt;a href=&quot;https://docs.python.org/3/reference/datamodel.html&quot;&gt;data model&lt;/a&gt;. It can also imply performance issues because you’ll be writing the methods in pure Python.&lt;/p&gt;
&lt;p&gt;Additionally, suppose you need to customize the functionality of any other standard list method, like &lt;a href=&quot;https://realpython.com/python-append/&quot;&gt;&lt;code&gt;.append()&lt;/code&gt;&lt;/a&gt; or &lt;code&gt;.insert()&lt;/code&gt;. In that case, you’ll have to override the default implementation and provide a suitable implementation that fulfills your needs.&lt;/p&gt;
&lt;p&gt;The main advantage of this strategy for creating list-like classes is that the parent ABC class will alert you if you miss any required methods in your custom implementation.&lt;/p&gt;
&lt;p&gt;In general, you should embrace this strategy only if you need a list-like class that’s fundamentally different from the built-in &lt;code&gt;list&lt;/code&gt; class.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll focus on creating list-like classes by inheriting from the built-in &lt;code&gt;list&lt;/code&gt; class and the &lt;code&gt;UserList&lt;/code&gt; class from the standard-library &lt;code&gt;collections&lt;/code&gt; module. These strategies seem to be the quickest and most practical ones.&lt;/p&gt;
&lt;h2 id=&quot;inheriting-from-pythons-built-in-list-class&quot;&gt;Inheriting From Python’s Built-in &lt;code&gt;list&lt;/code&gt; Class&lt;a class=&quot;headerlink&quot; href=&quot;#inheriting-from-pythons-built-in-list-class&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For a long time, it was impossible to inherit directly from Python types implemented in &lt;a href=&quot;https://realpython.com/c-for-python-programmers/&quot;&gt;C&lt;/a&gt;. Python 2.2 fixed this issue. Now you can &lt;a href=&quot;https://docs.python.org/3/whatsnew/2.2.html#peps-252-and-253-type-and-class-changes&quot;&gt;subclass built-in types&lt;/a&gt;, including &lt;code&gt;list&lt;/code&gt;. This change has brought several technical advantages to the subclasses because now they:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Will work in every place that requires the original built-in type&lt;/li&gt;
&lt;li&gt;Can define new &lt;a href=&quot;https://realpython.com/instance-class-and-static-methods-demystified/#instance-methods&quot;&gt;instance&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/instance-class-and-static-methods-demystified/#static-methods&quot;&gt;static&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/instance-class-and-static-methods-demystified/#class-methods&quot;&gt;class&lt;/a&gt; methods&lt;/li&gt;
&lt;li&gt;Can store their &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/#class-and-instance-attributes&quot;&gt;instance attributes&lt;/a&gt; in a &lt;a href=&quot;https://docs.python.org/3/reference/datamodel.html#object.__slots__&quot;&gt;&lt;code&gt;.__slots__&lt;/code&gt;&lt;/a&gt; class attribute, which essentially replaces the &lt;a href=&quot;https://docs.python.org/3/library/stdtypes.html#object.__dict__&quot;&gt;&lt;code&gt;.__dict__&lt;/code&gt;&lt;/a&gt; attribute&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/inherit-python-list/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/inherit-python-list/ »&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 #124: Exploring Recursion in Python With Al Sweigart</title>
      <id>https://realpython.com/podcasts/rpp/124/</id>
      <link href="https://realpython.com/podcasts/rpp/124/"/>
      <updated>2022-09-09T12:00:00+00:00</updated>
      <summary>Have you wanted to understand recursion and how to use it in Python? Are you familiar with the call stack and how it relates to tracebacks? This week on the show, Al Sweigart talks about his new book, &quot;The Recursive Book of Recursion.&quot;</summary>
      <content type="html">
        &lt;p&gt;Have you wanted to understand recursion and how to use it in Python? Are you familiar with the call stack and how it relates to tracebacks? This week on the show, Al Sweigart talks about his new book, &quot;The Recursive Book of Recursion.&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>HTML and CSS for Python Developers</title>
      <id>https://realpython.com/html-css-python/</id>
      <link href="https://realpython.com/html-css-python/"/>
      <updated>2022-09-07T14:00:00+00:00</updated>
      <summary>There&#x27;s no way around HTML and CSS when you want to build web apps.
Even if you&#x27;re not aiming to become a web developer, knowing the basics of HTML and CSS will help you understand the Web better.
In this tutorial, you&#x27;ll get an introduction to HTML and CSS for Python programmers.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;When you want to build websites as a Python programmer, there’s no way around HTML and CSS.
Almost every website on the Internet is built with &lt;strong&gt;HTML markup&lt;/strong&gt; to structure the page.
To make a website look nice, you can style HTML with &lt;strong&gt;CSS&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you’re interested in web development with Python, then knowing HTML and CSS will help you understand web frameworks like &lt;strong&gt;Django&lt;/strong&gt; and &lt;strong&gt;Flask&lt;/strong&gt; better.
But even if you’re just getting started with Python, HTML and CSS can enable you to create small websites to impress your friends.&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;Structure a basic &lt;strong&gt;HTML&lt;/strong&gt; file&lt;/li&gt;
&lt;li&gt;View and inspect HTML in your &lt;strong&gt;browser&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Insert &lt;strong&gt;images&lt;/strong&gt; and page &lt;strong&gt;links&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Style a website with &lt;strong&gt;CSS&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Format HTML with &lt;strong&gt;accessibility&lt;/strong&gt; in mind&lt;/li&gt;
&lt;li&gt;Use Python to &lt;strong&gt;write and parse&lt;/strong&gt; HTML code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll get an introduction to HTML and CSS that you can follow along with.
Throughout this tutorial, you’ll build a website with three pages and CSS styling:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 border&quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/740468859?background=1&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/figure&gt;

&lt;p&gt;While creating the web project, you’ll craft a boilerplate HTML document that you can use in your upcoming web projects.
You may find that the source code will come in handy when you’re working on future projects.
You can download it here:&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/html-css-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-html-css-python-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the supplemental materials for this tutorial&lt;/a&gt;, including a time-saving HTML template file.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;After learning the basics of HTML and CSS, you’ll find ideas on how to continue your journey at the end of the tutorial.&lt;/p&gt;
&lt;h2 id=&quot;create-your-first-html-file&quot;&gt;Create Your First HTML File&lt;a class=&quot;headerlink&quot; href=&quot;#create-your-first-html-file&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Think of any website that you’ve recently visited.
Maybe you read some news, chatted with friends, or watched a video.
No matter what kind of website it was, you can bet that its source code has a basic &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag at the beginning.&lt;/p&gt;
&lt;p&gt;HTML stands for &lt;strong&gt;HyperText Markup Language&lt;/strong&gt;.
HTML was created by &lt;a href=&quot;https://en.wikipedia.org/wiki/Tim_Berners-Lee&quot;&gt;Tim Berners-Lee&lt;/a&gt;, whose name might also ring a bell for you as the &lt;a href=&quot;https://en.wikipedia.org/wiki/World_Wide_Web&quot;&gt;inventor of the World Wide Web&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;hypertext&lt;/strong&gt; part of HTML refers to building connections between different HTML pages.
With hyperlinks, you can jump between pages and surf the Web.&lt;/p&gt;
&lt;p&gt;You use &lt;strong&gt;markup&lt;/strong&gt; to structure content in a document. 
In contrast to formatting, the markup defines the meaning of content and not how it looks.
In this section, you’ll learn about HTML elements and their roles.&lt;/p&gt;
&lt;p&gt;Writing &lt;strong&gt;semantic&lt;/strong&gt; HTML code will make your documents &lt;strong&gt;accessible&lt;/strong&gt; for a wide range of visitors.
After all, you want to enable everybody to consume your content, whether they’re visiting your page with a browser or using &lt;a href=&quot;https://en.wikipedia.org/wiki/Screen_reader&quot;&gt;screen reading&lt;/a&gt; tools.&lt;/p&gt;
&lt;p&gt;For each HTML element, there’s a standard that defines its intended use.
Today, the standards of HTML are defined by the &lt;a href=&quot;https://whatwg.org&quot;&gt;Web Hypertext Application Technology Working Group (WHATWG)&lt;/a&gt;.
The WHATWG plays a similar role for HTML as the &lt;a href=&quot;https://github.com/python/steering-council&quot;&gt;Python Steering Council&lt;/a&gt; does for Python.&lt;/p&gt;
&lt;p&gt;Approximately &lt;a href=&quot;https://w3techs.com/technologies/details/ml-html5&quot;&gt;95 percent of websites use HTML&lt;/a&gt;, so you’ll be hard-pressed to avoid it if you want to do any web development work in Python.&lt;/p&gt;
&lt;p&gt;In this section, you’ll start by creating your first HTML file.
You’ll learn how to structure your HTML code to make it readable for your browser and for humans.&lt;/p&gt;
&lt;h3 id=&quot;the-html-document&quot;&gt;The HTML Document&lt;a class=&quot;headerlink&quot; href=&quot;#the-html-document&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In this section, you’ll create a basic HTML file.
The HTML file will contain the base structure that most websites are built with.&lt;/p&gt;
&lt;p&gt;To start things off, create a file named &lt;code&gt;index.html&lt;/code&gt; with some text:&lt;/p&gt;
&lt;div class=&quot;highlight html&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;linenos&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;cm&quot;&gt;&amp;lt;!-- index.html --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 2&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 3&lt;/span&gt;Am I HTML already?
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Traditionally, the first file of your website is called &lt;code&gt;index.html&lt;/code&gt;.
You can think of the &lt;code&gt;index.html&lt;/code&gt; page as akin to the &lt;code&gt;main.py&lt;/code&gt; or &lt;code&gt;app.py&lt;/code&gt; file in a Python project.&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; Unless your server is configured differently, &lt;code&gt;index.html&lt;/code&gt; is the file that the server tries to load when you visit the root URL. That’s why you can visit &lt;a href=&quot;https://www.example.com/&quot;&gt;https://www.example.com/&lt;/a&gt; instead of typing the full &lt;a href=&quot;https://www.example.com/index.html&quot;&gt;https://www.example.com/index.html&lt;/a&gt; address.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;So far, the only content of &lt;code&gt;index.html&lt;/code&gt; is a plain &lt;code&gt;Am I HTML already?&lt;/code&gt; string.
You haven’t added any HTML syntax yet, except an &lt;strong&gt;HTML comment&lt;/strong&gt; on line 1.
Similar to the Python interpreter not executing comments in your Python code, the browser won’t render the contents of your &lt;a href=&quot;https://html.com/tags/comment-tag/&quot;&gt;HTML comments&lt;/a&gt;.
Still, go ahead and open &lt;code&gt;index.html&lt;/code&gt; in your browser:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/html-css-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/html-css-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>Building Command Line Interfaces With argparse</title>
      <id>https://realpython.com/courses/python-argparse-command-line-interfaces/</id>
      <link href="https://realpython.com/courses/python-argparse-command-line-interfaces/"/>
      <updated>2022-09-06T14:00:00+00:00</updated>
      <summary>In this step-by-step Python video course, you&#x27;ll learn how to take your command line Python scripts to the next level by adding a convenient command line interface that you can write with argparse.</summary>
      <content type="html">
        &lt;p&gt;One of the strengths of Python is that it comes with batteries included: it has a rich and versatile standard library that makes it one of the best programming languages for writing scripts for the &lt;a href=&quot;https://realpython.com/comparing-python-command-line-parsing-libraries-argparse-docopt-click/&quot;&gt;command line&lt;/a&gt;.
But, if you write &lt;a href=&quot;https://realpython.com/run-python-scripts/&quot;&gt;scripts&lt;/a&gt; for the command line, then you also need to provide a good command line interface, which you can create with the Python &lt;code&gt;argparse&lt;/code&gt; library.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What the Python &lt;code&gt;argparse&lt;/code&gt; library is, and why it&amp;rsquo;s important to use it if you need to write command line scripts in Python&lt;/li&gt;
&lt;li&gt;How to use the Python &lt;code&gt;argparse&lt;/code&gt; library to quickly create a simple CLI in Python&lt;/li&gt;
&lt;li&gt;What the advanced usage of the Python &lt;code&gt;argparse&lt;/code&gt; library is&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is for early &lt;a href=&quot;https://realpython.com/intermediate-python-project-ideas/&quot;&gt;intermediate&lt;/a&gt; Pythonistas who probably write scripts in Python for their everyday work but have never implemented a command line interface for their scripts. &lt;/p&gt;
&lt;p&gt;If that sounds like you, and you&amp;rsquo;re used to setting &lt;a href=&quot;https://realpython.com/python-variables/&quot;&gt;variable&lt;/a&gt; values at the beginning of your scripts or manually parsing the &lt;code&gt;sys.argv&lt;/code&gt; system list instead of using a more robust CLI development tool, then this video course is for you.&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 August 2022</title>
      <id>https://realpython.com/python-news-august-2022/</id>
      <link href="https://realpython.com/python-news-august-2022/"/>
      <updated>2022-09-05T14:00:00+00:00</updated>
      <summary>In August 2022, Python inched closer to the 3.11 release, pandas introduced enhancement proposals, various packages saw new releases, Python extended its lead at the top of the TIOBE index, and PyPI battled malware.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In &lt;strong&gt;August 2022&lt;/strong&gt;, Python inched closer to the &lt;strong&gt;3.11 release&lt;/strong&gt;, &lt;strong&gt;pandas&lt;/strong&gt; introduced &lt;strong&gt;enhancement proposals&lt;/strong&gt;, various packages saw &lt;strong&gt;new releases&lt;/strong&gt;, Python extended its lead at the top of the &lt;strong&gt;TIOBE index&lt;/strong&gt;, and &lt;strong&gt;PyPI&lt;/strong&gt; battled &lt;strong&gt;malware&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Read on for more details about what happened in the world of Python in August 2022!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Join Now:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-newsletter&quot; data-focus=&quot;false&quot;&gt;Click here to join the Real Python Newsletter&lt;/a&gt; and you&#x27;ll never miss another Python tutorial, course update, or post.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;python-has-peps-numpy-has-neps-pandas-now-has-pdeps&quot;&gt;Python Has PEPs, NumPy Has NEPs, pandas Now Has PDEPs&lt;a class=&quot;headerlink&quot; href=&quot;#python-has-peps-numpy-has-neps-pandas-now-has-pdeps&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first &lt;a href=&quot;https://pandas.pydata.org/&quot;&gt;pandas&lt;/a&gt; enhancement proposal (PDEP) was submitted on August 3, 2022, and was entitled &lt;em&gt;Purpose and guidelines&lt;/em&gt;. &lt;strong&gt;Enhancement proposals&lt;/strong&gt; aren’t new to the Python community. Python has had &lt;a href=&quot;https://peps.python.org/&quot;&gt;PEPs&lt;/a&gt; since 2000, and NumPy followed with &lt;a href=&quot;https://numpy.org/neps/&quot;&gt;NEPs&lt;/a&gt; in 2017.&lt;/p&gt;
&lt;p&gt;The first &lt;strong&gt;PDEP&lt;/strong&gt; follows in the tradition of PEPs and NEPs, with &lt;a href=&quot;https://pandas.pydata.org/pdeps/0001-purpose-and-guidelines.html&quot;&gt;PDEP-1&lt;/a&gt; being an introduction to the idea behind the enhancement proposals themselves.&lt;/p&gt;
&lt;p&gt;In a nutshell, PDEPs are intended to aid the proposal process for &lt;em&gt;major&lt;/em&gt; changes to pandas, such as moving a module from the main pandas repository to a break-off repository. PDEPs are not for quick fixes, but for major undertakings that involve the wider community and, more often than not, some significant trade-offs.&lt;/p&gt;
&lt;p&gt;Working out complex issues isn’t ideally suited to a thread-based medium, like &lt;a href=&quot;https://docs.github.com/en/issues/tracking-your-work-with-issues/about-issues&quot;&gt;GitHub issues&lt;/a&gt;. It can be hard for a discussion to stay focused if anyone can respond at any time, even if the original idea is a good one.&lt;/p&gt;
&lt;p&gt;GitHub issue threads can create noise not only for the core developers, but for contributors and end users too. Additionally, they can bury good but complex ideas by not providing an appropriate medium for discussing them. Contributor &lt;a href=&quot;https://github.com/h-vetinari&quot;&gt;h-vetinari&lt;/a&gt; raised this topic in a &lt;a href=&quot;https://github.com/pandas-dev/pandas/issues/28568&quot;&gt;GitHub issue&lt;/a&gt; in 2019:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The more intricate the API implications, the harder it is to discuss in GitHub comments (because there is usually too many things to consider at the same time, or the comments/threads get ridiculously long or both). That does not mean that the given change does not have merit though, just that it’s (likely) too hard to discuss in a thread format. (&lt;a href=&quot;https://github.com/pandas-dev/pandas/issues/28568#issuecomment-540456539&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The GitHub issue that h-vetinari raised three years ago has now been closed with the &lt;a href=&quot;https://github.com/pandas-dev/pandas/pull/47444&quot;&gt;pull request&lt;/a&gt; for PDEP-1. This may lay a blueprint for the PDEP life cycle going forward. PDEPs will probably get started when someone &lt;a href=&quot;https://github.com/pandas-dev/pandas/issues/new/choose&quot;&gt;creates an issue&lt;/a&gt;. If the issue is recognized as being significant and valuable, then the person who raised it may be directed to create a PDEP.&lt;/p&gt;
&lt;p&gt;This move to PDEPs means that the &lt;a href=&quot;https://pandas.pydata.org/about/roadmap.html&quot;&gt;roadmap&lt;/a&gt; that’s typically used for communicating larger changes to pandas will slowly migrate toward PDEPs.&lt;/p&gt;
&lt;p&gt;How do you feel about the move to PDEPs? Share your thoughts in the comments!&lt;/p&gt;
&lt;h2 id=&quot;python-ecosystem-celebrates-new-releases&quot;&gt;Python Ecosystem Celebrates New Releases&lt;a class=&quot;headerlink&quot; href=&quot;#python-ecosystem-celebrates-new-releases&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The Python community didn’t rest throughout August, even though it’s typically a month for vacations. As usual, there have been plenty of releases in the Python ecosystem. From CPython to CircuitPython, there are plenty of new features for you to start playing with. Read on for a selection of releases and milestones.&lt;/p&gt;
&lt;h3 id=&quot;cpython&quot;&gt;CPython&lt;a class=&quot;headerlink&quot; href=&quot;#cpython&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The CPython team is still gearing up for the release of Python 3.11 in October 2022. If you’re interested in learning more about the 3.11 release, check out some in-depth Real Python tutorials exploring the new 3.11 features, such as &lt;a href=&quot;https://realpython.com/python311-exception-groups/&quot;&gt;exception groups&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python311-tomllib/&quot;&gt;&lt;code&gt;tomllib&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python311-error-messages/&quot;&gt;better error messages&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-news-august-2022/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-news-august-2022/ »&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 #123: Creating a Python Code Completer &amp; More Abstract Syntax Tree Projects</title>
      <id>https://realpython.com/podcasts/rpp/123/</id>
      <link href="https://realpython.com/podcasts/rpp/123/"/>
      <updated>2022-09-02T12:00:00+00:00</updated>
      <summary>How does a code completion tool work? What is an Abstract Syntax Tree, and how is it created in Python? How does an AST help you write programs and projects that inspect and modify your Python code? This week on the show, Meredydd Luff, co-founder of Anvil, shares his PyCon talk, &quot;Building a Python Code Completer.&quot;</summary>
      <content type="html">
        &lt;p&gt;How does a code completion tool work? What is an Abstract Syntax Tree, and how is it created in Python? How does an AST help you write programs and projects that inspect and modify your Python code? This week on the show, Meredydd Luff, co-founder of Anvil, shares his PyCon talk, &quot;Building a Python Code Completer.&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>How Can You Install a Pre-Release Version of Python?</title>
      <id>https://realpython.com/python-pre-release/</id>
      <link href="https://realpython.com/python-pre-release/"/>
      <updated>2022-08-31T14:00:00+00:00</updated>
      <summary>If you want to have a peek at what&#x27;s coming in the next stable version of Python, then you can install a pre-release version. In this tutorial, you&#x27;ll learn how to access the latest Python versions and help test them.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The Python language is in constant development.
A new version is released &lt;a href=&quot;https://peps.python.org/pep-0602/&quot;&gt;annually&lt;/a&gt; in October to &lt;a href=&quot;https://realpython.com/python-news-october-2021/#a-live-python-310-release-party-on-youtube&quot;&gt;great fanfare&lt;/a&gt;.
Before these stable releases, you can preview the new features by installing a pre-release of Python.&lt;/p&gt;
&lt;p&gt;Volunteers worldwide work on developing Python by updating the &lt;strong&gt;documentation&lt;/strong&gt;, reporting &lt;strong&gt;issues&lt;/strong&gt;, suggesting and discussing &lt;strong&gt;improvements&lt;/strong&gt;, fixing &lt;strong&gt;bugs&lt;/strong&gt;, and implementing &lt;strong&gt;new features&lt;/strong&gt;.
You can join this work and &lt;a href=&quot;https://realpython.com/start-contributing-python/&quot;&gt;contribute&lt;/a&gt; to the efforts.&lt;/p&gt;
&lt;p&gt;The best way to start getting involved in the development of Python is to install and test early versions of the next release, whether it’s in the &lt;a href=&quot;https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha&quot;&gt;alpha&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/Software_release_life_cycle#Beta&quot;&gt;beta&lt;/a&gt;, or &lt;a href=&quot;https://en.wikipedia.org/wiki/Software_release_life_cycle#Release_candidate&quot;&gt;release candidate&lt;/a&gt; phase.
&lt;a href=&quot;https://twitter.com/pyblogsal&quot;&gt;Pablo Galindo Salgado&lt;/a&gt;, the release manager for Python 3.10 and 3.11, put it succinctly:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In summary: no matter who you are or what you do.
Test the beta releases!
(&lt;a href=&quot;https://discuss.python.org/t/the-last-3-11-beta-release-3-11-0b5-is-now-available/17693&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Python is essential to many people’s workflows and companies’ infrastructures.
Therefore, the community must thoroughly test new Python versions before the stable release.
You use Python differently from anyone else and may be able to reveal a bug that no one else has discovered.
Installing a pre-release version of Python and playing with it is valuable to the ecosystem.
Plus, it’s fun!&lt;/p&gt;
&lt;p&gt;You’re excited to install an early version of Python and try out the &lt;a href=&quot;https://realpython.com/search?kind=article&amp;amp;q=new+features&quot;&gt;latest features&lt;/a&gt;.
One question remains: &lt;strong&gt;How can you install a pre-release version of Python?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll learn about some options for getting your hands on an early version of Python and previewing its features.&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 Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-311-examples/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-311-examples&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download free sample code&lt;/a&gt; that demonstrates some of the new features of Python 3.11.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;in-short-use-pyenv-to-manage-several-versions-of-python-including-the-latest-pre-release&quot;&gt;In Short: Use &lt;code&gt;pyenv&lt;/code&gt; to Manage Several Versions of Python, Including the Latest Pre-Release&lt;a class=&quot;headerlink&quot; href=&quot;#in-short-use-pyenv-to-manage-several-versions-of-python-including-the-latest-pre-release&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You shouldn’t use a pre-release version of Python as the only Python on your computer.
By their nature, pre-releases may be unstable or have bugs that can interfere with your day-to-day Python work.
You should therefore install the pre-release version side by side with your regular Python.&lt;/p&gt;
&lt;p&gt;One great tool for installing and managing several versions of Python on your computer is &lt;a href=&quot;https://github.com/pyenv/pyenv&quot;&gt;&lt;code&gt;pyenv&lt;/code&gt;&lt;/a&gt;.
With &lt;code&gt;pyenv&lt;/code&gt;, you can install many Python versions on your computer and switch between them with a simple command.
You can even set up project-specific Python versions that are automatically invoked.&lt;/p&gt;
&lt;p&gt;If you’re not already using &lt;code&gt;pyenv&lt;/code&gt;, then you first need to install it.
How you install &lt;code&gt;pyenv&lt;/code&gt; depends on your operating system.
Choose your platform with the switcher below:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-windows&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body active small&quot; id=&quot;windows-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#windows-1&quot; role=&quot;tab&quot; aria-controls=&quot;windows-1&quot; aria-selected=&quot;true&quot;&gt;&lt;i class=&quot;fa fa-windows text-muted mr-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;Windows&lt;/a&gt;
  &lt;/li&gt;




  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-linuxmacos&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body small&quot; id=&quot;macos-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#linux-macos-1&quot; role=&quot;tab&quot; aria-controls=&quot;linux-macos-1&quot; aria-selected=&quot;false&quot;&gt;&lt;i class=&quot;fa fa-linux text-muted mr-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;&lt;i class=&quot;fa fa-apple text-muted mr-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;Linux + macOS&lt;/a&gt;
  &lt;/li&gt;

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-1&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;p&gt;On Windows, you should use the &lt;a href=&quot;https://github.com/pyenv-win/pyenv-win&quot;&gt;&lt;code&gt;pyenv&lt;/code&gt; for Windows&lt;/a&gt; fork.
The documentation &lt;a href=&quot;https://github.com/pyenv-win/pyenv-win#installation&quot;&gt;guides you&lt;/a&gt; through the installation process.
Check out &lt;a href=&quot;https://realpython.com/python-coding-setup-windows/#installing-python-with-pyenv-for-windows&quot;&gt;Your Python Coding Environment on Windows: Setup Guide&lt;/a&gt; for more information about integrating &lt;code&gt;pyenv&lt;/code&gt; into your system.&lt;/p&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-1&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;p&gt;On Linux and macOS, you can install &lt;code&gt;pyenv&lt;/code&gt; directly by following the instructions in the &lt;a href=&quot;https://github.com/pyenv/pyenv#installation&quot;&gt;documentation&lt;/a&gt;.
A good option is to use the &lt;a href=&quot;https://github.com/pyenv/pyenv-installer&quot;&gt;&lt;code&gt;pyenv-installer&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you want  an in-depth tutorial on how to use &lt;code&gt;pyenv&lt;/code&gt;, then check out &lt;a href=&quot;https://realpython.com/intro-to-pyenv/&quot;&gt;Managing Multiple Python Versions With &lt;code&gt;pyenv&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-pre-release/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-pre-release/ »&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 Basics: Functions and Loops</title>
      <id>https://realpython.com/courses/python-basics-functions-loops/</id>
      <link href="https://realpython.com/courses/python-basics-functions-loops/"/>
      <updated>2022-08-30T14:00:00+00:00</updated>
      <summary>In this Python Basics video course, you&#x27;ll learn how to create user-defined functions that you can execute several times throughout your code. You&#x27;ll also try your hand at repeating code with for and while loops.</summary>
      <content type="html">
        &lt;p&gt;Functions are the building blocks of almost every Python program.
They&amp;rsquo;re where the real action takes place!&lt;/p&gt;
&lt;p&gt;In your Python Basics journey, you&amp;rsquo;ve probably encountered functions such as &lt;code&gt;print()&lt;/code&gt;, &lt;code&gt;len()&lt;/code&gt;, and &lt;code&gt;round()&lt;/code&gt;. These are all &lt;strong&gt;built-in functions&lt;/strong&gt; because they come built into the Python language itself. You can also create &lt;strong&gt;user-defined functions&lt;/strong&gt; that perform specific tasks.&lt;/p&gt;
&lt;p&gt;Functions break code into smaller chunks and are great for defining
actions that a program will execute several times throughout your
code. Instead of writing the same code each time the program needs
to perform the same task, just call the function!&lt;/p&gt;
&lt;p&gt;But sometimes you do need to repeat some code several times in a row.
This is where &lt;strong&gt;loops&lt;/strong&gt; come in.&lt;/p&gt;
&lt;p&gt;In this Python Basics video course, you&amp;rsquo;ll learn:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to create &lt;strong&gt;user-defined functions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to write &lt;strong&gt;&lt;code&gt;for&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;while&lt;/code&gt; loops&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. You can also check out the other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course.&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 and PyQt: Building a GUI Desktop Calculator</title>
      <id>https://realpython.com/python-pyqt-gui-calculator/</id>
      <link href="https://realpython.com/python-pyqt-gui-calculator/"/>
      <updated>2022-08-29T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to create graphical user interface (GUI) applications with Python and PyQt. Once you&#x27;ve covered the basics, you&#x27;ll build a fully functional desktop calculator that can respond to user events with concrete actions.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Even though web and mobile applications appear to have taken over the software development market, there’s still demand for traditional &lt;strong&gt;graphical user interface (GUI)&lt;/strong&gt; desktop applications. If you’re interested in building these kinds of applications in Python, then you’ll find a wide variety of libraries to choose from. They include &lt;a href=&quot;https://docs.python.org/3/library/tkinter.html&quot;&gt;Tkinter&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-gui-with-wxpython/&quot;&gt;wxPython&lt;/a&gt;, &lt;a href=&quot;https://www.riverbankcomputing.com/software/pyqt/intro&quot;&gt;PyQt&lt;/a&gt;, &lt;a href=&quot;https://wiki.qt.io/Qt_for_Python&quot;&gt;PySide&lt;/a&gt;, and a few others.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll learn the basics of building GUI desktop applications with Python and &lt;strong&gt;PyQt&lt;/strong&gt;.&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 &lt;strong&gt;graphical user interfaces&lt;/strong&gt; with Python and PyQt&lt;/li&gt;
&lt;li&gt;Connect the &lt;strong&gt;user’s events&lt;/strong&gt; on the app’s GUI with the &lt;strong&gt;app’s logic&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Organize a PyQt app using a proper &lt;strong&gt;project layout&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Create a &lt;strong&gt;fully functional GUI application&lt;/strong&gt; with PyQt&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For this tutorial, you’ll create a calculator app with Python and PyQt. This short project will help you grasp the fundamentals and get you up and running with this GUI library.&lt;/p&gt;
&lt;p&gt;You can download the source code for the project and all examples in this tutorial by clicking on 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;Download Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/pyqt-calculator/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-pyqt-calculator&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the code that you’ll use&lt;/a&gt; to build a calculator in Python with PyQt in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;getting-to-know-pyqt&quot;&gt;Getting to Know PyQt&lt;a class=&quot;headerlink&quot; href=&quot;#getting-to-know-pyqt&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;PyQt is a Python binding for &lt;a href=&quot;https://wiki.qt.io/About_Qt&quot;&gt;Qt&lt;/a&gt;, which is a set of &lt;a href=&quot;https://realpython.com/python-vs-cpp/&quot;&gt;C++&lt;/a&gt; libraries and development tools providing platform-independent abstractions for graphical user interfaces (GUIs). Qt also provides tools for networking, &lt;a href=&quot;https://realpython.com/python-pyqt-qthread/&quot;&gt;threads&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/regex-python/&quot;&gt;regular expressions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-pyqt-database/&quot;&gt;SQL databases&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/Scalable_Vector_Graphics&quot;&gt;SVG&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/OpenGL&quot;&gt;OpenGL&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/XML&quot;&gt;XML&lt;/a&gt;, and many other powerful features.&lt;/p&gt;
&lt;p&gt;Developed by &lt;a href=&quot;https://riverbankcomputing.com&quot;&gt;RiverBank Computing Ltd&lt;/a&gt;, PyQt’s latest editions are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.riverbankcomputing.com/static/Docs/PyQt5/&quot;&gt;PyQt5&lt;/a&gt;: An edition that’s built against Qt 5.x only&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.riverbankcomputing.com/static/Docs/PyQt6/&quot;&gt;PyQt6&lt;/a&gt;: An edition that’s built against Qt 6.x only&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In this tutorial, you’ll use PyQt6, as this version is the future of the library. From now on, be sure to consider any mention of PyQt as a reference to PyQt6.&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; If you want to dive deeper into the differences between these two versions of the library, then check out the &lt;a href=&quot;https://www.riverbankcomputing.com/static/Docs/PyQt6/pyqt5_differences.html&quot;&gt;PyQt6 documentation&lt;/a&gt; on the topic.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;PyQt6 is based on &lt;a href=&quot;https://doc.qt.io/qt.html&quot;&gt;Qt v6&lt;/a&gt;. Therefore, it provides &lt;a href=&quot;https://www.riverbankcomputing.com/static/Docs/PyQt6/sip-classes.html&quot;&gt;classes&lt;/a&gt; and tools for GUI creation, &lt;a href=&quot;https://realpython.com/python-xml-parser/&quot;&gt;XML&lt;/a&gt; handling, network communication, regular expressions, threads, SQL databases, web browsing, and other technologies available in Qt. PyQt6 implements binding for many Qt classes in a set of &lt;a href=&quot;https://www.riverbankcomputing.com/static/Docs/PyQt6/module_index.html&quot;&gt;Python modules&lt;/a&gt;, which are organized in a top-level Python &lt;a href=&quot;https://realpython.com/python-modules-packages/&quot;&gt;package&lt;/a&gt; called &lt;code&gt;PyQt6&lt;/code&gt;. For PyQt6 to work, you need Python 3.6.1 or later.&lt;/p&gt;
&lt;p&gt;PyQt6 is compatible with Windows, Unix, Linux, macOS, iOS, and Android. This is an attractive feature if you’re looking for a GUI framework to develop multiplatform applications that have a native look and feel on each platform.&lt;/p&gt;
&lt;p&gt;PyQt6 is available under two licenses:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://riverbankcomputing.com/commercial/buy&quot;&gt;The Riverbank Commercial License&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.en.html&quot;&gt;The General Public License (GPL), version 3&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Your PyQt6 license must be compatible with your Qt license. If you use the GPL license, then your code must also use a GPL-compatible license. If you want to use PyQt6 to create commercial applications, then you need a commercial license for your installation.&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; The &lt;a href=&quot;https://www.qt.io/&quot;&gt;Qt Company&lt;/a&gt; has developed and currently maintains its own Python binding for the Qt library. The Python library is called &lt;a href=&quot;https://wiki.qt.io/Qt_for_Python&quot;&gt;Qt for Python&lt;/a&gt; and is the official Qt for Python. Its Python package is called PySide.&lt;/p&gt;
&lt;p&gt;PyQt and PySide are both built on top of Qt. Their APIs are quite similar because they reflect the Qt API. That’s why porting PyQt code to PySide can be as simple as updating some imports. If you learn one of them, then you’ll be able to work with the other with minimal effort. If you want to dive deeper into the differences between these two libraries, then you can check out &lt;a href=&quot;https://www.pythonguis.com/faq/pyqt6-vs-pyside6/&quot;&gt;PyQt6 vs PySide6&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;If you need more information about PyQt6 licensing, then check out the license &lt;a href=&quot;https://www.riverbankcomputing.com/commercial/license-faq&quot;&gt;FAQs page&lt;/a&gt; on the project’s official documentation.&lt;/p&gt;
&lt;h2 id=&quot;installing-pyqt&quot;&gt;Installing PyQt&lt;a class=&quot;headerlink&quot; href=&quot;#installing-pyqt&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You have several options for installing PyQt on your system or development environment. The recommended option is to use to use binary &lt;a href=&quot;https://www.riverbankcomputing.com/static/Docs/PyQt6/installation.html#installing-from-wheels&quot;&gt;wheels&lt;/a&gt;. Wheels are the standard way to install Python packages from the Python package index, &lt;a href=&quot;https://realpython.com/pypi-publish-python-package/&quot;&gt;PyPI&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In any case, you need to consider that wheels for PyQt6 are only available for Python 3.6.1 and later. There are wheels for Linux, macOS, and Windows (64-bit).&lt;/p&gt;
&lt;p&gt;All of these wheels include copies of the corresponding Qt libraries, so you won’t need to install them separately.&lt;/p&gt;
&lt;p&gt;Another installation option is to build PyQt from source. This can be a bit complicated, so you might want to avoid it if possible. If you really need to build from source, then check out what the library’s &lt;a href=&quot;https://www.riverbankcomputing.com/static/Docs/PyQt6/installation.html#building-and-installing-from-source&quot;&gt;documentation&lt;/a&gt; recommends in those cases.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-pyqt-gui-calculator/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-pyqt-gui-calculator/ »&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>Building a URL Shortener With FastAPI and Python</title>
      <id>https://realpython.com/courses/url-shortener-fastapi/</id>
      <link href="https://realpython.com/courses/url-shortener-fastapi/"/>
      <updated>2022-08-23T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll build an app to create and manage shortened URLs. Your Python URL shortener can receive a full target URL and return a shortened URL. You&#x27;ll also use the automatically created documentation of FastAPI to try out your API endpoints.</summary>
      <content type="html">
        &lt;p&gt;In this video course, you&amp;rsquo;ll build a URL shortener with Python and FastAPI.
URLs can be extremely long and not user-friendly.
This is where a URL shortener can come in handy.
A URL shortener reduces the number of characters in a URL, making it easier to read, remember, and share.&lt;/p&gt;
&lt;p&gt;By following this step-by-step project, you&amp;rsquo;ll build a URL shortener with Python and &lt;strong&gt;FastAPI&lt;/strong&gt;.
At the end of this course, you&amp;rsquo;ll have a fully functional &lt;strong&gt;API-driven web app&lt;/strong&gt; that creates shortened URLs that forward to target URLs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a &lt;strong&gt;REST API&lt;/strong&gt; with FastAPI&lt;/li&gt;
&lt;li&gt;Run a development web server with &lt;strong&gt;Uvicorn&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Model an &lt;strong&gt;SQLite&lt;/strong&gt; database&lt;/li&gt;
&lt;li&gt;Investigate the auto-generated &lt;strong&gt;API documentation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Interact with the database with &lt;strong&gt;CRUD actions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Optimize your app by &lt;strong&gt;refactoring&lt;/strong&gt; your code &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This URL shortener project is for intermediate Python programmers who want to try out &lt;a href=&quot;https://fastapi.tiangolo.com&quot;&gt;FastAPI&lt;/a&gt; and learn about API design, CRUD, and interaction with a database.
To follow along, it&amp;rsquo;ll help if you&amp;rsquo;re familiar with the basics of handling &lt;a href=&quot;https://realpython.com/urllib-request/&quot;&gt;HTTP requests&lt;/a&gt;.
If you need a refresher on FastAPI, &lt;a href=&quot;https://realpython.com/fastapi-python-web-apis/&quot;&gt;Using FastAPI to Build Python Web APIs&lt;/a&gt; is a great introduction.&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 Real Python Podcast – Episode #122: Configuring a Coding Environment on Windows &amp; Using TOML With Python</title>
      <id>https://realpython.com/podcasts/rpp/122/</id>
      <link href="https://realpython.com/podcasts/rpp/122/"/>
      <updated>2022-08-19T12:00:00+00:00</updated>
      <summary>Have you attempted to set up a Python development environment on Windows before? Would it be helpful to have an easy-to-follow guide to get you started? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you attempted to set up a Python development environment on Windows before? Would it be helpful to have an easy-to-follow guide to get you started? This week on the show, Christopher Trudeau is here, bringing 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>Caching in Python With lru_cache</title>
      <id>https://realpython.com/courses/caching-python-lru/</id>
      <link href="https://realpython.com/courses/caching-python-lru/"/>
      <updated>2022-08-16T14:00:00+00:00</updated>
      <summary>Caching is an essential optimization technique. In this video course, you&#x27;ll learn how to use Python&#x27;s @lru_cache decorator to cache the results of your functions using the LRU cache strategy. This is a powerful technique you can use to leverage the power of caching in your implementations.</summary>
      <content type="html">
        &lt;p&gt;There are many ways to achieve fast and responsive applications. &lt;strong&gt;Caching&lt;/strong&gt; is one approach that, when used correctly, makes things much faster while decreasing the load on computing resources. &lt;/p&gt;
&lt;p&gt;Python&amp;rsquo;s &lt;a href=&quot;https://docs.python.org/3/library/functools.html&quot;&gt;&lt;code&gt;functools&lt;/code&gt; module&lt;/a&gt; comes with the &lt;a href=&quot;https://docs.python.org/3/library/functools.html#functools.lru_cache&quot;&gt;&lt;code&gt;@lru_cache&lt;/code&gt; decorator&lt;/a&gt;, which gives you the ability to cache the result of your functions using the &lt;strong&gt;Least Recently Used (LRU) strategy&lt;/strong&gt;. This is a simple yet powerful technique that you can use to leverage the power of caching in your code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;caching strategies&lt;/strong&gt; are available and how to implement them using &lt;strong&gt;Python decorators&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What the &lt;strong&gt;LRU strategy&lt;/strong&gt; is and how it works&lt;/li&gt;
&lt;li&gt;How to improve performance by caching with the &lt;strong&gt;&lt;code&gt;@lru_cache&lt;/code&gt; decorator&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to expand the functionality of the &lt;code&gt;@lru_cache&lt;/code&gt; decorator and make it &lt;strong&gt;expire&lt;/strong&gt; after a specific time&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By the end of this video course, you&amp;rsquo;ll have a deeper understanding of how caching works and how to take advantage of it in Python.&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 Real Python Podcast – Episode #121: Moving NLP Forward With Transformer Models and Attention</title>
      <id>https://realpython.com/podcasts/rpp/121/</id>
      <link href="https://realpython.com/podcasts/rpp/121/"/>
      <updated>2022-08-12T12:00:00+00:00</updated>
      <summary>What&#x27;s the big breakthrough for Natural Language Processing (NLP) that has dramatically advanced machine learning into deep learning? What makes these transformer models unique, and what defines &quot;attention?&quot; This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, continues our talk about how machine learning (ML) models understand and generate text.</summary>
      <content type="html">
        &lt;p&gt;What&#x27;s the big breakthrough for Natural Language Processing (NLP) that has dramatically advanced machine learning into deep learning? What makes these transformer models unique, and what defines &quot;attention?&quot; This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, continues our talk about how machine learning (ML) models understand and generate text.&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>Exploring Special Function Parameters</title>
      <id>https://realpython.com/courses/special-function-parameters/</id>
      <link href="https://realpython.com/courses/special-function-parameters/"/>
      <updated>2022-08-09T14:00:00+00:00</updated>
      <summary>In this Code Conversation video course, you&#x27;ll explore special function parameters that allow for positional-only arguments, keyword-only arguments, or a combination of the two.</summary>
      <content type="html">
        &lt;p&gt;Have you ever come across the forward slash (&lt;code&gt;/&lt;/code&gt;) and asterisk (&lt;code&gt;*&lt;/code&gt;) symbols in the documentation for your favorite libraries? These represent special parameters, which tell you what kinds of arguments you can use to call a given function. In Python, these parameters can help you ensure that your functions are used correctly.&lt;/p&gt;
&lt;p&gt;Maybe you&amp;rsquo;re a regular at Real Python&amp;rsquo;s weekly &lt;a href=&quot;https://realpython.com/office-hours/&quot;&gt;Office Hours&lt;/a&gt; meetup, or perhaps you&amp;rsquo;re curious about what happens there. You&amp;rsquo;ll get a glimpse in this Code Conversation, which answers one participant&amp;rsquo;s question of how to interpret and apply special function parameters in writing and calling functions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this Code Conversation video course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set &lt;strong&gt;default values&lt;/strong&gt; for arguments&lt;/li&gt;
&lt;li&gt;Write &lt;strong&gt;positional-only&lt;/strong&gt;, &lt;strong&gt;keyword-only&lt;/strong&gt;, and &lt;strong&gt;combined&lt;/strong&gt; functions&lt;/li&gt;
&lt;li&gt;Refer to the &lt;strong&gt;forward slash (&lt;code&gt;/&lt;/code&gt;)&lt;/strong&gt; and &lt;strong&gt;asterisk (&lt;code&gt;*&lt;/code&gt;)&lt;/strong&gt; accurately&lt;/li&gt;
&lt;li&gt;Use special function parameters in &lt;strong&gt;real-world code&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 #120: Inspiring Young People to Learn Python With Mission Encodeable</title>
      <id>https://realpython.com/podcasts/rpp/120/</id>
      <link href="https://realpython.com/podcasts/rpp/120/"/>
      <updated>2022-08-05T12:00:00+00:00</updated>
      <summary>Is there someone in your life you&#x27;d like to inspire to learn Python? Mission Encodeable is a website designed to teach people to code, built by two high-school students. This week on the show, Anna and Harry Wake talk about creating their site and motivating people to start coding.</summary>
      <content type="html">
        &lt;p&gt;Is there someone in your life you&#x27;d like to inspire to learn Python? Mission Encodeable is a website designed to teach people to code, built by two high-school students. This week on the show, Anna and Harry Wake talk about creating their site and motivating people to start coding.&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 Basics: Finding and Fixing Code Bugs</title>
      <id>https://realpython.com/courses/python-basics-code-bugs/</id>
      <link href="https://realpython.com/courses/python-basics-code-bugs/"/>
      <updated>2022-08-02T14:00:00+00:00</updated>
      <summary>In this Python Basics video course, you&#x27;ll learn how to identify and fix logic errors, or bugs, in your Python code. You&#x27;ll use the built-in debugging tools in Python&#x27;s Integrated Development and Learning Environment to practice locating and resolving bugs in an example function.</summary>
      <content type="html">
        &lt;p&gt;Everyone makes mistakes—even seasoned professional developers!&lt;/p&gt;
&lt;p&gt;IDLE is pretty good at catching mistakes like syntax errors and run-time errors, but there&amp;rsquo;s a third type of error that you may have already experienced. &lt;strong&gt;Logic errors&lt;/strong&gt; occur when an otherwise valid program doesn&amp;rsquo;t do what was intended.&lt;/p&gt;
&lt;p&gt;Logic errors cause unexpected behaviors called &lt;strong&gt;bugs&lt;/strong&gt;. Removing bugs is called &lt;strong&gt;debugging&lt;/strong&gt;, and a &lt;strong&gt;debugger&lt;/strong&gt; is a tool that helps you hunt down bugs and understand why they&amp;rsquo;re happening.&lt;/p&gt;
&lt;p&gt;Knowing how to find and fix bugs in your code is a skill that you will use for your entire coding career!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this &lt;em&gt;Python Basics&lt;/em&gt; video course, you&amp;rsquo;ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Learn how to use &lt;strong&gt;IDLE&amp;rsquo;s Debug Control&lt;/strong&gt; window&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Practice debugging&lt;/strong&gt; on a buggy function&lt;/li&gt;
&lt;li&gt;Learn &lt;strong&gt;alternative methods&lt;/strong&gt; for debugging your code&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 #119: Natural Language Processing and How ML Models Understand Text</title>
      <id>https://realpython.com/podcasts/rpp/119/</id>
      <link href="https://realpython.com/podcasts/rpp/119/"/>
      <updated>2022-07-29T12:00:00+00:00</updated>
      <summary>How do you process and classify text documents in Python? What are the fundamental techniques and building blocks for Natural Language Processing (NLP)? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, talks about how machine learning (ML) models understand text.</summary>
      <content type="html">
        &lt;p&gt;How do you process and classify text documents in Python? What are the fundamental techniques and building blocks for Natural Language Processing (NLP)? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, talks about how machine learning (ML) models understand text.&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>Managing Attributes With Python&#x27;s property()</title>
      <id>https://realpython.com/courses/property-python/</id>
      <link href="https://realpython.com/courses/property-python/"/>
      <updated>2022-07-26T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll learn how to create managed attributes, also known as properties, using Python&#x27;s property() in your custom classes.</summary>
      <content type="html">
        &lt;p&gt;With Python&amp;rsquo;s &lt;a href=&quot;https://docs.python.org/3/library/functions.html#property&quot;&gt;&lt;code&gt;property()&lt;/code&gt;&lt;/a&gt;, you can create &lt;strong&gt;managed attributes&lt;/strong&gt; in your classes. You can use managed attributes, also known as &lt;strong&gt;properties&lt;/strong&gt;, when you need to modify their internal implementation without changing the public &lt;a href=&quot;https://en.wikipedia.org/wiki/API&quot;&gt;API&lt;/a&gt; of the class. Providing stable APIs can help you avoid breaking your users&amp;rsquo; code when they rely on your classes and objects.&lt;/p&gt;
&lt;p&gt;Properties are arguably the most popular way to create managed attributes quickly and in the purest &lt;a href=&quot;https://realpython.com/learning-paths/writing-pythonic-code/&quot;&gt;Pythonic&lt;/a&gt; style.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create &lt;strong&gt;managed attributes&lt;/strong&gt; or &lt;strong&gt;properties&lt;/strong&gt; in your classes&lt;/li&gt;
&lt;li&gt;Perform &lt;strong&gt;lazy attribute evaluation&lt;/strong&gt; and provide &lt;strong&gt;computed attributes&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Avoid &lt;strong&gt;setter&lt;/strong&gt; and &lt;strong&gt;getter&lt;/strong&gt; methods to make your classes more Pythonic&lt;/li&gt;
&lt;li&gt;Create &lt;strong&gt;read-only&lt;/strong&gt;, &lt;strong&gt;read-write&lt;/strong&gt;, and &lt;strong&gt;write-only&lt;/strong&gt; properties&lt;/li&gt;
&lt;li&gt;Create consistent and &lt;strong&gt;backwards-compatible APIs&lt;/strong&gt; for your classes&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 #118: Creating Documentation With MkDocs &amp; When to Use a Python dict</title>
      <id>https://realpython.com/podcasts/rpp/118/</id>
      <link href="https://realpython.com/podcasts/rpp/118/"/>
      <updated>2022-07-22T12:00:00+00:00</updated>
      <summary>How do you start building your project documentation? What if you had a tool that could do the heavy lifting and automatically write large portions directly from your code? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;How do you start building your project documentation? What if you had a tool that could do the heavy lifting and automatically write large portions directly from your code? This week on the show, Christopher Trudeau is here, bringing 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>
  

</feed>
