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

  
    <entry>
      <title>The Real Python Podcast – Episode #18: Ten Years of Flask: Conversation With Creator Armin Ronacher</title>
      <id>https://realpython.com/podcasts/rpp/18/</id>
      <link href="https://realpython.com/podcasts/rpp/18/"/>
      <updated>2020-07-17T12:00:00+00:00</updated>
      <summary>This week on the show we have Armin Ronacher to talk about the first 10 years of Flask. Armin talks about the origins of Flask and the components that make up the framework. He talks about what goes into documenting a framework or API. He also talks about the community working on the ongoing development of Flask.</summary>
      <content type="html">
        &lt;p&gt;This week on the show we have Armin Ronacher to talk about the first 10 years of Flask. Armin talks about the origins of Flask and the components that make up the framework. He talks about what goes into documenting a framework or API. He also talks about the community working on the ongoing development of Flask.&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>Pandas Project: Make a Gradebook With Python &amp; Pandas</title>
      <id>https://realpython.com/pandas-project-gradebook/</id>
      <link href="https://realpython.com/pandas-project-gradebook/"/>
      <updated>2020-07-15T14:00:00+00:00</updated>
      <summary>In this Python pandas project, you&#x27;ll build a script to calculate grades for a class. The script will quickly and accurately calculate grades from a variety of data sources. You&#x27;ll see examples of loading, merging, and saving data with pandas, as well as plotting some summary statistics.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;One of the jobs that all teachers have in common is &lt;strong&gt;evaluating students&lt;/strong&gt;. Whether you use exams, homework assignments, quizzes, or projects, you usually have to turn students’ scores into a &lt;strong&gt;letter grade&lt;/strong&gt; at the end of the term. This often involves a bunch of calculations that you might do in a spreadsheet. Instead, you can consider using Python and &lt;a href=&quot;https://pandas.pydata.org/about/index.html&quot;&gt;pandas&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One problem with using a spreadsheet is that it can be hard to see when you make a mistake in a formula. Maybe you selected the wrong column and put quizzes where exams should go. Maybe you found the maximum of two incorrect values. To solve this problem, you can use &lt;strong&gt;Python and pandas&lt;/strong&gt; to do all your calculations and find and fix those mistakes much faster.&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;&lt;strong&gt;Load&lt;/strong&gt; and &lt;strong&gt;merge&lt;/strong&gt; data from multiple sources with pandas&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filter&lt;/strong&gt; and &lt;strong&gt;group&lt;/strong&gt; data in a pandas DataFrame&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Calculate&lt;/strong&gt; and &lt;strong&gt;plot&lt;/strong&gt; grades in a pandas DataFrame&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Click the link below to download the code for this pandas project and follow along as you build your gradebook script:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Get the Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/pandas_gradebook_project/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-pandas_gradebook_project&quot; data-focus=&quot;false&quot;&gt;Click here to get the source code you&#x27;ll use&lt;/a&gt; to build a gradebook with pandas in this tutorial.&lt;/p&gt;&lt;/div&gt;

&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Build It:&lt;/strong&gt; In this tutorial, you’ll &lt;strong&gt;build a full project from start to finish&lt;/strong&gt;. If you’d like to learn more about pandas, then check out the &lt;a href=&quot;https://realpython.com/learning-paths/pandas-data-science/&quot;&gt;pandas learning path&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;demo-what-youll-build&quot;&gt;Demo: What You’ll Build&lt;/h2&gt;
&lt;p&gt;In this pandas project, you’re going to create a Python script that loads your grade data and calculates letter grades for your students. Check out this video for a demonstration of the script in action: &lt;/p&gt;
&lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 &quot;&gt;
  &lt;iframe class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/435136619&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;p&gt;Your script will run from the command line or your IDE and will produce CSV output files so you can paste the grades into your school’s grading system. You’ll also produce a few plots to take a look at how your grades are distributed.&lt;/p&gt;
&lt;h2 id=&quot;project-overview&quot;&gt;Project Overview&lt;/h2&gt;
&lt;p&gt;This pandas project involves four main steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Explore the data&lt;/strong&gt; you’ll use in the project to determine which format and data you’ll need to calculate your final grades.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Load the data&lt;/strong&gt; into pandas DataFrames, making sure to connect the grades for the same student across all your data sources.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Calculate the final grades&lt;/strong&gt; and save them as CSV files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plot the grade distribution&lt;/strong&gt; and explore how the grades vary among your students.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Once you complete these steps, you’ll have a working Python script that can calculate your grades. Your grades will be in a format that you should be able to upload to your school’s student administration system.&lt;/p&gt;
&lt;h2 id=&quot;background-reading&quot;&gt;Background Reading&lt;/h2&gt;
&lt;p&gt;You’ll get the most out of this pandas project if you have a little bit of experience working with pandas. If you need a refresher, then these tutorials and courses will get you up to speed for this project:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/pandas-dataframe/&quot;&gt;The Pandas DataFrame: Make Working With Data Delightful&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/lessons/basic-pandas-data-structures/&quot;&gt;Basic Pandas Data Structures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/pandas-read-write-files/#read-a-csv-file&quot;&gt;Pandas: How to Read and Write Files&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/lessons/reading-csvs-pandas/&quot;&gt;Reading CSVs With Pandas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/pandas-merge-join-and-concat/&quot;&gt;Combining Data in Pandas With &lt;code&gt;merge()&lt;/code&gt;, &lt;code&gt;.join()&lt;/code&gt;, and &lt;code&gt;concat()&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Don’t worry too much about memorizing all the details in those tutorials. You’ll see a practical application of the topics in this pandas project. Now let’s take a look at the data you’ll be using in this project!&lt;/p&gt;
&lt;h2 id=&quot;exploring-the-data-for-this-pandas-project&quot;&gt;Exploring the Data for This Pandas Project&lt;/h2&gt;
&lt;p&gt;Like most teachers, you probably used a variety of services to manage your class this term, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The school’s student administration system&lt;/li&gt;
&lt;li&gt;A service to manage assigning and grading homework and exams&lt;/li&gt;
&lt;li&gt;A service to manage assigning and grading quizzes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For the purposes of this project, you’ll use sample data that represents what you might get out of these systems. The data is in comma-separated values (CSV) files. Some samples of the data are shown here. First, there’s a file that contains the roster information for the class. This would come from your student administration system:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class=&quot;text-right&quot;&gt;ID&lt;/th&gt;
&lt;th class=&quot;text-left&quot;&gt;Name&lt;/th&gt;
&lt;th class=&quot;text-left&quot;&gt;NetID&lt;/th&gt;
&lt;th class=&quot;text-left&quot;&gt;Email Address&lt;/th&gt;
&lt;th class=&quot;text-right&quot;&gt;Section&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&quot;text-right&quot;&gt;1234567&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;“Barrera Jr., Woody”&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;WXB12345&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;WOODY.BARRERA_JR@UNIV.EDU&lt;/td&gt;
&lt;td class=&quot;text-right&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;text-right&quot;&gt;2345678&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;“Lambert, Malaika”&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;MXL12345&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;MALAIKA.LAMBERT@UNIV.EDU&lt;/td&gt;
&lt;td class=&quot;text-right&quot;&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;text-right&quot;&gt;3456789&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;“Joyce, Traci”&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;TXJ12345&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;TRACI.JOYCE@UNIV.EDU&lt;/td&gt;
&lt;td class=&quot;text-right&quot;&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;text-right&quot;&gt;4567890&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;“Flower, John Gregg”&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;JGF12345&lt;/td&gt;
&lt;td class=&quot;text-left&quot;&gt;JOHN.G.2.FLOWER@UNIV.EDU&lt;/td&gt;
&lt;td class=&quot;text-right&quot;&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;This table indicates each student’s ID number, name, NetID, and email address as well as the section of the class that they belong to. In this term, you taught one class that met at different times, and each class time has a different section number.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/pandas-project-gradebook/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/pandas-project-gradebook/ »&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>Grow Your Python Portfolio With 13 Intermediate Project Ideas</title>
      <id>https://realpython.com/courses/intermediate-project-ideas/</id>
      <link href="https://realpython.com/courses/intermediate-project-ideas/"/>
      <updated>2020-07-14T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how you can get started on 13 Python project ideas that are just right for intermediate Python developers. They&#x27;ll challenge you enough to help you become a better Pythonista but will still be doable!</summary>
      <content type="html">
        &lt;p&gt;Now that you know the basics of Python, you can put that knowledge to use by &lt;strong&gt;building projects&lt;/strong&gt; to put in your portfolio. The trick is finding project ideas that are just right for your level. Creating a variety of applications is a way to &lt;strong&gt;demonstrate your knowledge&lt;/strong&gt; and share it with others. &lt;/p&gt;
&lt;p&gt;In this course, you&amp;rsquo;ll get 13 project ideas that you can work on as an intermediate Python developer. The project ideas cover a wide range of application type and can be built using a command line, web based, or graphical user interface. You&amp;rsquo;ll see examples of existing applications for inspiration, and get links to Python libraries and resources to assist in your application development.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The importance of &lt;strong&gt;building projects&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;The major &lt;strong&gt;platforms&lt;/strong&gt; you can build projects for&lt;/li&gt;
&lt;li&gt;Thirteen &lt;strong&gt;project ideas&lt;/strong&gt; you can work on&lt;/li&gt;
&lt;li&gt;Some &lt;strong&gt;tips&lt;/strong&gt; for working on projects&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>Learn IP Address Concepts With Python&#x27;s ipaddress Module</title>
      <id>https://realpython.com/python-ipaddress-module/</id>
      <link href="https://realpython.com/python-ipaddress-module/"/>
      <updated>2020-07-13T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn how to inspect and manipulate IP addresses as Python objects with Python&#x27;s ipaddress module, improving your understanding of IP address mechanics and patterns used by the module.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python’s &lt;a href=&quot;https://docs.python.org/3/library/ipaddress.html&quot;&gt;&lt;code&gt;ipaddress&lt;/code&gt;&lt;/a&gt; module is an underappreciated gem from the Python standard library. You don’t have to be a full-blown network engineer to have been exposed to IP addresses in the wild. &lt;strong&gt;IP addresses&lt;/strong&gt; and &lt;strong&gt;networks&lt;/strong&gt; are ubiquitous in software development and infrastructure. They underpin how computers, well, &lt;em&gt;address&lt;/em&gt; each other.&lt;/p&gt;
&lt;p&gt;Learning through doing is an effective way to master IP addresses. The &lt;code&gt;ipaddress&lt;/code&gt; module allows you to do just that by viewing and manipulating IP addresses as Python objects. In this tutorial, you’ll get a better grasp of IP addresses by using some of the features of Python’s &lt;code&gt;ipaddress&lt;/code&gt; module.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How &lt;strong&gt;IP addresses&lt;/strong&gt; work, both in theory and in Python code&lt;/li&gt;
&lt;li&gt;How &lt;strong&gt;IP networks&lt;/strong&gt; represent groups of IP addresses and how you can inspect relationships between the two&lt;/li&gt;
&lt;li&gt;How Python’s &lt;strong&gt;&lt;code&gt;ipaddress&lt;/code&gt; module&lt;/strong&gt; cleverly uses a classic design pattern to allow you to do more with less&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To follow along, you just need Python 3.3 or higher since &lt;code&gt;ipaddress&lt;/code&gt; was added to the Python standard library in that version. The examples in this tutorial were generated using Python 3.8.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/cpython-internals-sample/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-cpython-internals-sample&quot; data-focus=&quot;false&quot;&gt;Get a sample chapter from CPython Internals: Your Guide to the Python 3 Interpreter&lt;/a&gt; showing you how to unlock the inner workings of the Python language, compile the Python interpreter from source  code, and participate in the development of CPython.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;ip-addresses-in-theory-and-practice&quot;&gt;IP Addresses in Theory and Practice&lt;/h2&gt;
&lt;p&gt;If you remember only one concept about IP addresses, then remember this: &lt;em&gt;an IP address is an integer.&lt;/em&gt; This piece of information will help you better understand both how IP addresses function and how they can be represented as Python objects.&lt;/p&gt;
&lt;p&gt;Before you jump into any Python code, it can be helpful to see this concept fleshed out mathematically. If you’re here just for some examples of how to use the &lt;code&gt;ipaddress&lt;/code&gt; module, then you can skip down to the &lt;a href=&quot;#the-python-ipaddress-module&quot;&gt;next section&lt;/a&gt;, on using the module itself.&lt;/p&gt;
&lt;h3 id=&quot;mechanics-of-ip-addresses&quot;&gt;Mechanics of IP Addresses&lt;/h3&gt;
&lt;p&gt;You saw above that an IP address boils down to an integer. A fuller definition is that an &lt;strong&gt;IPv4 address&lt;/strong&gt; is a 32-bit integer used to represent a host on a network. The term &lt;strong&gt;host&lt;/strong&gt; is sometimes used synonymously with an address.&lt;/p&gt;
&lt;p&gt;It follows that there are 2&lt;sup&gt;32&lt;/sup&gt; possible IPv4 addresses, from 0 to 4,294,967,295 (where the upper bound is 2&lt;sup&gt;32&lt;/sup&gt; - 1). But this is a tutorial for human beings, not robots. No one wants to ping the IP address &lt;code&gt;0xdc0e0925&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;The more common way to express an IPv4 address is using &lt;strong&gt;quad-dotted notation&lt;/strong&gt;, which consists of four dot-separated decimal integers:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;220.14.9.37
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It’s not immediately obvious what underlying integer the address &lt;code&gt;220.14.9.37&lt;/code&gt; represents, though. Formulaically, you can break the IP address &lt;code&gt;220.14.9.37&lt;/code&gt; into its four &lt;strong&gt;octet&lt;/strong&gt; components:&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;p&quot;&gt;(&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;mi&quot;&gt;220&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;256&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;+&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;     &lt;span class=&quot;mi&quot;&gt;14&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;256&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&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;gp&quot;&gt;... &lt;/span&gt;      &lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;256&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;o&quot;&gt;+&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;     &lt;span class=&quot;mi&quot;&gt;37&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;256&lt;/span&gt; &lt;span class=&quot;o&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;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;3691907365&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;As shown above, the address &lt;code&gt;220.14.9.37&lt;/code&gt; represents the integer 3,691,907,365. Each octet is a &lt;a href=&quot;https://realpython.com/python-encodings-guide/#we-need-more-bits&quot;&gt;byte&lt;/a&gt;, or a number from 0 to 255. Given this, you can infer that the maximum IPv4 address is &lt;code&gt;255.255.255.255&lt;/code&gt; (or &lt;code&gt;FF.FF.FF.FF&lt;/code&gt; in hex notation), while the minimum is &lt;code&gt;0.0.0.0&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Next, you’ll see how Python’s &lt;code&gt;ipaddress&lt;/code&gt; module does this calculation for you, allowing you to work with the human-readable form and let the address arithmetic occur out of sight.&lt;/p&gt;
&lt;h3 id=&quot;the-python-ipaddress-module&quot;&gt;The Python &lt;code&gt;ipaddress&lt;/code&gt; Module&lt;/h3&gt;
&lt;p&gt;To follow along, you can fetch your computer’s external IP address to work with at the 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; curl -sS ifconfig.me/ip
&lt;span class=&quot;go&quot;&gt;220.14.9.37&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This requests your IP address from the site &lt;a href=&quot;https://ifconfig.me/&quot;&gt;ifconfig.me&lt;/a&gt;, which can be used to show an array of details about your connection and network.&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 the interest of technical correctness, this is quite possibly not your computer’s very own public IP address. If your connection sits behind a &lt;a href=&quot;https://en.wikipedia.org/wiki/Network_address_translation&quot;&gt;NATed&lt;/a&gt; router, then it’s better thought of as an “agent” IP through which you reach the Internet.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Now open up a Python REPL. You can use the &lt;code&gt;IPv4Address&lt;/code&gt; class to build a Python object that encapsulates an address:&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;ipaddress&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IPv4Address&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;addr&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IPv4Address&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;220.14.9.37&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&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;addr&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;IPv4Address(&#x27;220.14.9.37&#x27;)&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-ipaddress-module/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-ipaddress-module/ »&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 #17: Linear Programming, PySimpleGUI, and More</title>
      <id>https://realpython.com/podcasts/rpp/17/</id>
      <link href="https://realpython.com/podcasts/rpp/17/"/>
      <updated>2020-07-10T12:00:00+00:00</updated>
      <summary>Are you familiar with linear programming, and how it can be used to solve resource optimization problems? Would you like to free your Python code from a clunky command line and start making convenient graphical interfaces for your users? This week on the show, David Amos is back with another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Are you familiar with linear programming, and how it can be used to solve resource optimization problems? Would you like to free your Python code from a clunky command line and start making convenient graphical interfaces for your users? This week on the show, David Amos is back with another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python import: Advanced Techniques and Tips</title>
      <id>https://realpython.com/python-import/</id>
      <link href="https://realpython.com/python-import/"/>
      <updated>2020-07-08T14:00:00+00:00</updated>
      <summary>The Python import system is as powerful as it is useful. In this in-depth tutorial, you&#x27;ll learn how to harness this power to improve the structure and maintainability of your code.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In Python, you use the &lt;strong&gt;&lt;code&gt;import&lt;/code&gt;&lt;/strong&gt; keyword to make code in one &lt;strong&gt;module&lt;/strong&gt; available in another. Imports in Python are important for &lt;strong&gt;structuring your code&lt;/strong&gt; effectively. Using imports properly will make you more productive, allowing you to reuse code while keeping your projects maintainable.&lt;/p&gt;
&lt;p&gt;This tutorial will provide a thorough overview of Python’s &lt;code&gt;import&lt;/code&gt; statement and how it works. The import system is powerful, and you’ll learn how to harness this power. While you’ll cover many of the concepts behind Python’s import system, this tutorial is mostly example driven. You’ll learn from several code examples throughout.&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;Use &lt;strong&gt;modules&lt;/strong&gt;, &lt;strong&gt;packages&lt;/strong&gt;, and &lt;strong&gt;namespace packages&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Handle &lt;strong&gt;resources&lt;/strong&gt; and &lt;strong&gt;data files&lt;/strong&gt; inside your packages&lt;/li&gt;
&lt;li&gt;Import modules &lt;strong&gt;dynamically&lt;/strong&gt; at runtime&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Customize&lt;/strong&gt; Python’s import system&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Throughout the tutorial, you’ll see examples of how to play with the Python import machinery in order to work most efficiently. While all the code is shown in the tutorial, you can also download it by clicking the box below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Get the Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-import/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-import&quot; data-focus=&quot;false&quot;&gt;Click here to get the source code you&#x27;ll use&lt;/a&gt; to learn about the Python import system in this tutorial.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;basic-python-import&quot;&gt;Basic Python &lt;code&gt;import&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Python code is organized into both &lt;a href=&quot;https://realpython.com/python-modules-packages&quot;&gt;modules and packages&lt;/a&gt;. This section will explain how they differ and how you can work with them.&lt;/p&gt;
&lt;p&gt;Later in the tutorial, you’ll see some advanced and lesser-known uses of Python’s import system. However, let’s get started with the basics: importing modules and packages.&lt;/p&gt;
&lt;h3 id=&quot;modules&quot;&gt;Modules&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&quot;https://docs.python.org/glossary.html&quot;&gt;Python.org glossary&lt;/a&gt; defines &lt;strong&gt;module&lt;/strong&gt; as follows:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;An object that serves as an organizational unit of Python code. Modules have a namespace containing arbitrary Python objects. Modules are loaded into Python by the process of importing. (&lt;a href=&quot;https://docs.python.org/glossary.html#term-module&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In practice, a module usually corresponds to one &lt;code&gt;.py&lt;/code&gt; file containing Python code.&lt;/p&gt;
&lt;p&gt;The true power of modules is that they can be imported and reused in other code. Consider the following example:&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;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;math&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;math&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pi&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;3.141592653589793&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In the first line, &lt;code&gt;import math&lt;/code&gt;, you import the code in the &lt;a href=&quot;https://realpython.com/python-math-module/&quot;&gt;&lt;code&gt;math&lt;/code&gt; module&lt;/a&gt; and make it available to use. In the second line, you access the &lt;code&gt;pi&lt;/code&gt; variable within the &lt;code&gt;math&lt;/code&gt; module. &lt;code&gt;math&lt;/code&gt; is part of &lt;a href=&quot;https://docs.python.org/library/index.html&quot;&gt;Python’s standard library&lt;/a&gt;, which means that it’s always available to import when you’re running Python.&lt;/p&gt;
&lt;p&gt;Note that you write &lt;code&gt;math.pi&lt;/code&gt; and not just simply &lt;code&gt;pi&lt;/code&gt;. In addition to being a module, &lt;code&gt;math&lt;/code&gt; acts as a &lt;strong&gt;namespace&lt;/strong&gt; that keeps all the attributes of the module together. Namespaces are useful for keeping your code readable and organized. In the words of Tim Peters:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Namespaces are one honking great idea—let’s do more of those! (&lt;a href=&quot;https://www.python.org/dev/peps/pep-0020/&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can list the contents of a namespace with &lt;code&gt;dir()&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;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;math&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;dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[&#x27;__annotations__&#x27;, &#x27;__builtins__&#x27;, ..., &#x27;math&#x27;]&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;dir&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[&#x27;__doc__&#x27;, ..., &#x27;nan&#x27;, &#x27;pi&#x27;, &#x27;pow&#x27;, ...]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Using &lt;code&gt;dir()&lt;/code&gt; without any argument shows what’s in the global namespace. To see the contents of the &lt;code&gt;math&lt;/code&gt; namespace, you use &lt;code&gt;dir(math)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You’ve already seen the most straightforward use of &lt;code&gt;import&lt;/code&gt;. However, there are other ways to use it that allow you to import specific parts of a module and to rename the module as you import it.&lt;/p&gt;
&lt;p&gt;The following code imports only the &lt;code&gt;pi&lt;/code&gt; variable from the &lt;code&gt;math&lt;/code&gt; module:&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;math&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pi&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;pi&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;3.141592653589793&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;math&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pi&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;NameError: name &#x27;math&#x27; is not defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Note that this places &lt;code&gt;pi&lt;/code&gt; in the global namespace and not within a &lt;code&gt;math&lt;/code&gt; namespace.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-import/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-import/ »&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>Pointers and Objects in Python</title>
      <id>https://realpython.com/courses/pointers-python/</id>
      <link href="https://realpython.com/courses/pointers-python/"/>
      <updated>2020-07-07T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll learn about Python&#x27;s object model and see why pointers don&#x27;t really exist in Python. You&#x27;ll also cover ways to simulate pointers in Python without managing memory.</summary>
      <content type="html">
        &lt;p&gt;If you&amp;rsquo;ve ever worked with lower-level languages like C or C++, then you may have heard of &lt;strong&gt;pointers&lt;/strong&gt;. Pointers are essentially variables that hold the memory address of another variable. They allow you to create great efficiency in parts of your code but can lead to various memory management bugs.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll learn about &lt;strong&gt;Python&amp;rsquo;s object model&lt;/strong&gt; and see why pointers in Python don&amp;rsquo;t really exist. For the cases where you need to mimic pointer behavior, you&amp;rsquo;ll learn ways to simulate pointers in Python without managing memory.&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;Learn why &lt;strong&gt;pointers&lt;/strong&gt; in Python don&amp;rsquo;t exist&lt;/li&gt;
&lt;li&gt;Explore the difference between &lt;strong&gt;C variables&lt;/strong&gt; and &lt;strong&gt;Python names&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simulate pointers&lt;/strong&gt; in Python&lt;/li&gt;
&lt;li&gt;Experiment with real pointers using &lt;strong&gt;&lt;code&gt;ctypes&lt;/code&gt;&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>Object-Oriented Programming (OOP) in Python 3</title>
      <id>https://realpython.com/python3-object-oriented-programming/</id>
      <link href="https://realpython.com/python3-object-oriented-programming/"/>
      <updated>2020-07-06T16:21:50+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn all about object-oriented programming (OOP) in Python. You&#x27;ll learn the basics of the OOP paradigm and cover concepts like classes and inheritance. You&#x27;ll also see to how instantiate an object from a class.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;Object-oriented programming&lt;/strong&gt; (OOP) is a method of structuring a program by bundling related properties and behaviors into individual &lt;strong&gt;objects&lt;/strong&gt;. In this tutorial, you’ll learn the basics of object-oriented programming in Python.&lt;/p&gt;
&lt;p&gt;Conceptually, objects are like the components of a system. Think of a program as a factory assembly line of sorts. At each step of the assembly line a system component processes some material, ultimately transforming raw material into a finished product.&lt;/p&gt;
&lt;p&gt;An object contains data, like the raw or preprocessed materials at each step on an assembly line, and behavior, like the action each assembly line component performs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a &lt;strong&gt;class&lt;/strong&gt;, which is like a blueprint for creating an object&lt;/li&gt;
&lt;li&gt;Use classes to &lt;strong&gt;create new objects&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Model systems with &lt;strong&gt;class inheritance&lt;/strong&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; This tutorial is adapted from the chapter “Object-Oriented Programming (OOP)” in &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;.&lt;/p&gt;
&lt;p&gt;The book uses Python’s built-in &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; editor to create and edit Python files and interact with the Python shell, so you will see occasional references to IDLE throughout this tutorial. However, you should have no problems running the example code from the editor and environment of your choice.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-oop/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-oop&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a free Python OOP Cheat Sheet&lt;/a&gt; that points you to the best tutorials, videos, and books to learn more about Object-Oriented Programming with Python.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;what-is-object-oriented-programming-in-python&quot;&gt;What Is Object-Oriented Programming in Python?&lt;/h2&gt;
&lt;p&gt;Object-oriented programming is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Programming_paradigm&quot;&gt;programming paradigm&lt;/a&gt; that provides a means of structuring programs so that properties and behaviors are bundled into individual &lt;strong&gt;objects&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;For instance, an object could represent a person with &lt;strong&gt;properties&lt;/strong&gt; like a name, age, and address and &lt;strong&gt;behaviors&lt;/strong&gt; such as walking, talking, breathing, and running. Or it could represent an email with properties like a recipient list, subject, and body and behaviors like adding attachments and sending. &lt;/p&gt;
&lt;p&gt;Put another way, object-oriented programming is an approach for modeling concrete, real-world things, like cars, as well as relations between things, like companies and employees, students and teachers, and so on. OOP models real-world entities as software objects that have some data associated with them and can perform certain functions.&lt;/p&gt;
&lt;p&gt;Another common programming paradigm is &lt;strong&gt;procedural programming&lt;/strong&gt;, which structures a program like a recipe in that it provides a set of steps, in the form of functions and code blocks, that flow sequentially in order to complete a task.&lt;/p&gt;
&lt;p&gt;The key takeaway is that objects are at the center of object-oriented programming in Python, not only representing the data, as in procedural programming, but in the overall structure of the program as well.&lt;/p&gt;
&lt;h2 id=&quot;define-a-class-in-python&quot;&gt;Define a Class in Python&lt;/h2&gt;
&lt;p&gt;Primitive &lt;a href=&quot;https://realpython.com/courses/python-data-types/&quot;&gt;data structures&lt;/a&gt;—like numbers, strings, and lists—are designed to represent simple pieces of information, such as the cost of an apple, the name of a poem, or your favorite colors, respectively. What if you want to represent something more complex?&lt;/p&gt;
&lt;p&gt;For example, let’s say you want to track employees in an organization. You need to store some basic information about each employee, such as their name, age, position, and the year they started working.&lt;/p&gt;
&lt;p&gt;One way to do this is to represent each employee as a &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;list&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;n&quot;&gt;kirk&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;James Kirk&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;34&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Captain&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2265&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;spock&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Spock&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Science Officer&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2254&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;mccoy&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Leonard McCoy&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Chief Medical Officer&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2266&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;There are a number of issues with this approach.&lt;/p&gt;
&lt;p&gt;First, it can make larger code files more difficult to manage. If you reference &lt;code&gt;kirk[0]&lt;/code&gt; several lines away from where the &lt;code&gt;kirk&lt;/code&gt; list is declared, will you remember that the element with index &lt;code&gt;0&lt;/code&gt; is the employee’s name? &lt;/p&gt;
&lt;p&gt;Second, it can introduce errors if not every employee has the same number of elements in the list. In the &lt;code&gt;mccoy&lt;/code&gt; list above, the age is missing, so &lt;code&gt;mccoy[1]&lt;/code&gt; will return &lt;code&gt;&quot;Chief Medical Officer&quot;&lt;/code&gt; instead of Dr. McCoy’s age.&lt;/p&gt;
&lt;p&gt;A great way to make this type of code more manageable and more maintainable is to use &lt;strong&gt;classes&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&quot;classes-vs-instances&quot;&gt;Classes vs Instances&lt;/h3&gt;
&lt;p&gt;Classes are used to create user-defined data structures. Classes define functions called &lt;strong&gt;methods&lt;/strong&gt;, which identify the behaviors and actions that an object created from the class can perform with its data.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll create a &lt;code&gt;Dog&lt;/code&gt; class that stores some information about the characteristics and behaviors that an individual dog can have.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python3-object-oriented-programming/ »&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 #16: Thinking in Pandas: Python Data Analysis the Right Way</title>
      <id>https://realpython.com/podcasts/rpp/16/</id>
      <link href="https://realpython.com/podcasts/rpp/16/"/>
      <updated>2020-07-03T12:00:00+00:00</updated>
      <summary>Are you using the Python library Pandas the right way? Do you wonder about getting better performance, or how to optimize your data for analysis? What does normalization mean?  This week on the show we have Hannah Stepanek to discuss her new book &quot;Thinking in Pandas&quot;.</summary>
      <content type="html">
        &lt;p&gt;Are you using the Python library Pandas the right way? Do you wonder about getting better performance, or how to optimize your data for analysis? What does normalization mean?  This week on the show we have Hannah Stepanek to discuss her new book &quot;Thinking in Pandas&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>Get Started With Django Part 2: Django User Management</title>
      <id>https://realpython.com/django-user-management/</id>
      <link href="https://realpython.com/django-user-management/"/>
      <updated>2020-07-01T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn how to extend your Django application with a user management system, complete with email sending and third-party authentication.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you finished the &lt;a href=&quot;https://realpython.com/get-started-with-django-1/&quot;&gt;first part&lt;/a&gt; of this series, then you may already have a lot of ideas for your own Django applications. At some point, you might decide to extend them with user accounts. In this step-by-step tutorial, you’ll learn how to work with Django user management and add it to your program.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create an application where users can &lt;strong&gt;register&lt;/strong&gt;, &lt;strong&gt;log in&lt;/strong&gt;, and &lt;strong&gt;reset&lt;/strong&gt; and &lt;strong&gt;change passwords&lt;/strong&gt; on their own&lt;/li&gt;
&lt;li&gt;Edit the default &lt;strong&gt;Django templates&lt;/strong&gt; responsible for &lt;strong&gt;user management&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Send password reset emails&lt;/strong&gt; to actual email addresses&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authenticate&lt;/strong&gt; using an &lt;strong&gt;external service&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let’s get started!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;#&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-django-resources-learing-guide&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a free Django Learning Resources Guide (PDF)&lt;/a&gt; that shows you tips and tricks as well as common pitfalls to avoid when building Python + Django web applications.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;set-up-a-django-project&quot;&gt;Set Up a Django Project&lt;/h2&gt;
&lt;p&gt;This tutorial uses Django 3.0 and Python 3.6. It focuses on user management, so you won’t use any advanced or responsive styling. It also doesn’t deal with &lt;a href=&quot;https://realpython.com/manage-users-in-django-admin/&quot;&gt;groups and permissions&lt;/a&gt;, only with creating and managing user accounts.&lt;/p&gt;
&lt;p&gt;It’s a good idea to use a virtual environment when working with Python projects. That way, you can always be sure that the &lt;code&gt;python&lt;/code&gt; command points to the right version of Python and that the modules required by your project have correct versions. To read more about it, check out &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;Python Virtual Environments: A Primer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To set up a virtual environment on Linux and macOS, run these commands:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python3 -m venv venv
&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; venv/bin/activate
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python -m pip install --upgrade pip
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python -m pip install django
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;To activate a virtual environment on Windows, run this command:&lt;/p&gt;
&lt;div class=&quot;highlight doscon&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;C:\&amp;gt;&lt;/span&gt; venv\Scripts\activate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now that the environment is ready, you can create a new project and an application to store all your user management code:&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 gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; django-admin startproject awesome_website
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; awesome_website
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python manage.py startapp users
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In this example, your application is called &lt;code&gt;users&lt;/code&gt;. Keep in mind that you need to install it by adding it to &lt;code&gt;INSTALLED_APPS&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;c1&quot;&gt;# awesome_website/settings.py&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;INSTALLED_APPS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
&lt;span class=&quot;hll&quot;&gt;    &lt;span class=&quot;s2&quot;&gt;&quot;users&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.admin&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.auth&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.contenttypes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.sessions&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.messages&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.staticfiles&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&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;Next, apply the migrations and run the server:&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 gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python manage.py migrate
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python manage.py runserver
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This will create all user-related models in the database and start your application at &lt;code&gt;http://localhost:8000/&lt;/code&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 this tutorial, you’ll be using Django’s built-in user model. In practice, you would more likely create a custom user model, extending the functionality offered by Django. You can read more about customizing the default user model in &lt;a href=&quot;https://docs.djangoproject.com/en/3.0/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project&quot;&gt;Django’s documentation&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;There’s one more thing you should do for this setup. By default, Django enforces strong passwords to make user accounts less prone to attacks. But you’re going to change passwords very often during the course of this tutorial, and figuring out a strong password each time would be very inconvenient. &lt;/p&gt;
&lt;p&gt;You can solve this issue by disabling password validators in settings. Just comment them out, leaving an empty list:&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;# awesome_website/settings.py&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;AUTH_PASSWORD_VALIDATORS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# {&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#     &quot;NAME&quot;: &quot;django.contrib.auth.password_validation.UserAttributeSimilarityValidator&quot;,&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# },&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# {&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#     &quot;NAME&quot;: &quot;django.contrib.auth.password_validation.MinimumLengthValidator&quot;,&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# },&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# {&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#     &quot;NAME&quot;: &quot;django.contrib.auth.password_validation.CommonPasswordValidator&quot;,&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# },&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# {&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#     &quot;NAME&quot;: &quot;django.contrib.auth.password_validation.NumericPasswordValidator&quot;,&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# },&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;Now Django will allow you to set passwords like &lt;code&gt;password&lt;/code&gt; or even &lt;code&gt;pass&lt;/code&gt;, making your work with the user management system much easier. &lt;em&gt;Just remember to enable the validators in your actual application!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;For this tutorial, it would also be useful to have access to the admin panel so you can track newly created users and their passwords. Go ahead and create an admin user:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/django-user-management/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/django-user-management/ »&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>Unicode in Python: Working With Character Encodings</title>
      <id>https://realpython.com/courses/python-unicode/</id>
      <link href="https://realpython.com/courses/python-unicode/"/>
      <updated>2020-06-30T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll get a Python-centric introduction to character encodings and Unicode. Handling character encodings and numbering systems can at times seem painful and complicated, but this guide is here to help with easy-to-follow Python examples.</summary>
      <content type="html">
        &lt;p&gt;Python&amp;rsquo;s &lt;strong&gt;Unicode&lt;/strong&gt; support is strong and robust, but it takes some time to master. There are many ways of encoding text into binary data, and in this course you&amp;rsquo;ll learn a bit of the history of encodings. You&amp;rsquo;ll also spend time learning the intricacies of Unicode, &lt;strong&gt;UTF-8&lt;/strong&gt;, and how to use them when programming Python. You&amp;rsquo;ll practice with multiple examples and see how smooth working with text and binary data in Python can be!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll know:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What an &lt;strong&gt;encoding&lt;/strong&gt; is&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;ASCII&lt;/strong&gt; is&lt;/li&gt;
&lt;li&gt;How binary displays as &lt;strong&gt;octal&lt;/strong&gt; and &lt;strong&gt;hex&lt;/strong&gt; values&lt;/li&gt;
&lt;li&gt;How UTF-8 encodes a &lt;strong&gt;code point&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to combine code points into a single &lt;strong&gt;glyph&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;built-in functions&lt;/strong&gt; can help you&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>Python&#x27;s reduce(): From Functional to Pythonic Style</title>
      <id>https://realpython.com/python-reduce-function/</id>
      <link href="https://realpython.com/python-reduce-function/"/>
      <updated>2020-06-29T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn how Python&#x27;s reduce() works and how to use it effectively in your programs. You&#x27;ll also learn some more modern, efficient, and Pythonic ways to gently replace reduce() in your programs.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python’s &lt;a href=&quot;https://docs.python.org/3/library/functools.html#functools.reduce&quot;&gt;&lt;code&gt;reduce()&lt;/code&gt;&lt;/a&gt; is a function that implements a mathematical technique called &lt;a href=&quot;https://en.wikipedia.org/wiki/Fold_(higher-order_function)&quot;&gt;&lt;strong&gt;folding&lt;/strong&gt;&lt;/a&gt; or &lt;strong&gt;reduction&lt;/strong&gt;. &lt;code&gt;reduce()&lt;/code&gt; is useful when you need to apply a function to an iterable and reduce it to a single cumulative value. Python’s &lt;code&gt;reduce()&lt;/code&gt; is popular among developers with a &lt;strong&gt;functional programming&lt;/strong&gt; background, but Python has more to offer.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll cover how &lt;code&gt;reduce()&lt;/code&gt; works and how to use it effectively. You’ll also cover some alternative Python tools that can be more &lt;a href=&quot;https://realpython.com/learning-paths/writing-pythonic-code/&quot;&gt;Pythonic&lt;/a&gt;, readable, and efficient than &lt;code&gt;reduce()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How Python’s &lt;strong&gt;&lt;code&gt;reduce()&lt;/code&gt;&lt;/strong&gt; works&lt;/li&gt;
&lt;li&gt;What the more common reduction &lt;strong&gt;use cases&lt;/strong&gt; are&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;solve&lt;/strong&gt; these use cases using &lt;code&gt;reduce()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;alternative Python tools&lt;/strong&gt; are available to solve these same use cases&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With this knowledge, you’ll be able to decide which tools to use when it comes to solving reduction or folding problems in Python.&lt;/p&gt;
&lt;p&gt;For a better understanding of Python’s &lt;code&gt;reduce()&lt;/code&gt;, it would be helpful to have some previous knowledge of how to work with &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-iterable&quot;&gt;Python iterables&lt;/a&gt;, especially how to loop over them using a &lt;a href=&quot;https://realpython.com/courses/python-for-loop/&quot;&gt;&lt;code&gt;for&lt;/code&gt; loop&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-tricks-sample-pdf/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-tricks-sample-pdf&quot; data-focus=&quot;false&quot;&gt;Get a sample chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python&#x27;s best practices with simple examples you can apply instantly to write more beautiful + Pythonic code.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;exploring-functional-programming-in-python&quot;&gt;Exploring Functional Programming in Python&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://realpython.com/courses/functional-programming-python/&quot;&gt;Functional programming&lt;/a&gt; is a programming paradigm based on breaking down a problem into a set of individual functions. Ideally, every function only takes a set of input arguments and produces an output. &lt;/p&gt;
&lt;p&gt;In functional programming, functions don’t have any internal state that affects the output that they produce for a given input. This means that anytime you call a function with the same set of input arguments, you’ll get the same result or output.&lt;/p&gt;
&lt;p&gt;In a functional program, input data flows through a set of functions. Each function operates on its input and produces some output. Functional programming tries to avoid mutable data types and state changes as much as possible. It works with the data that flow between functions.&lt;/p&gt;
&lt;p&gt;Other core features of functional programming include the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The use of &lt;a href=&quot;https://realpython.com/python-thinking-recursively/&quot;&gt;&lt;strong&gt;recursion&lt;/strong&gt;&lt;/a&gt; rather than loops or other structures as a primary flow control structure &lt;/li&gt;
&lt;li&gt;A focus on &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt; or arrays processing&lt;/li&gt;
&lt;li&gt;A focus on &lt;em&gt;what&lt;/em&gt; is to be computed rather than on &lt;em&gt;how&lt;/em&gt; to compute it&lt;/li&gt;
&lt;li&gt;The use of &lt;a href=&quot;https://en.wikipedia.org/wiki/Pure_function&quot;&gt;pure functions&lt;/a&gt; that avoid &lt;strong&gt;side effects&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;The use of &lt;a href=&quot;http://en.wikipedia.org/wiki/Higher-order_function&quot;&gt;higher-order functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are several important concepts in this list. Here’s a closer look to some of them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Recursion&lt;/strong&gt; is a technique in which functions call themselves, either directly or indirectly, in order to loop. It allows a program to loop over data structures that have unknown or unpredictable lengths.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pure functions&lt;/strong&gt; are functions that have no side effects at all. In other words, they’re functions that do not update or modify any global variable, object, or data structure in the program. These functions produce an output that depends only on the input, which is closer to the concept of a mathematical function.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Higher-order functions&lt;/strong&gt; are functions that operate on other functions by taking functions as arguments, returning functions, or both, as with &lt;a href=&quot;https://realpython.com/primer-on-python-decorators/&quot;&gt;Python decorators&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since Python is a multi-paradigm programming language, it provides some tools that support a functional programming style:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Functions as &lt;a href=&quot;https://realpython.com/primer-on-python-decorators/#first-class-objects&quot;&gt;first-class objects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/courses/thinking-recursively-python/&quot;&gt;Recursion&lt;/a&gt; capabilities&lt;/li&gt;
&lt;li&gt;Anonymous functions with &lt;a href=&quot;https://realpython.com/python-lambda/&quot;&gt;&lt;code&gt;lambda&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.python.org/3/glossary.html#term-iterator&quot;&gt;Iterators&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/introduction-to-python-generators/&quot;&gt;generators&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Standard modules like &lt;a href=&quot;https://docs.python.org/3/library/functools.html#module-functools&quot;&gt;&lt;code&gt;functools&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-itertools/&quot;&gt;&lt;code&gt;itertools&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Tools like &lt;a href=&quot;https://docs.python.org/3/library/functions.html#map&quot;&gt;&lt;code&gt;map()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/library/functions.html#filter&quot;&gt;&lt;code&gt;filter()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/library/functools.html#functools.reduce&quot;&gt;&lt;code&gt;reduce()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/library/functions.html#sum&quot;&gt;&lt;code&gt;sum()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/library/functions.html#len&quot;&gt;&lt;code&gt;len()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/any-python/&quot;&gt;&lt;code&gt;any()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/library/functions.html#all&quot;&gt;&lt;code&gt;all()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/library/functions.html#min&quot;&gt;&lt;code&gt;min()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://docs.python.org/3/library/functions.html#max&quot;&gt;&lt;code&gt;max()&lt;/code&gt;&lt;/a&gt;, and so on&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even though Python &lt;a href=&quot;http://python-history.blogspot.com/2009/04/origins-of-pythons-functional-features.html&quot;&gt;isn’t heavily influenced&lt;/a&gt; by functional programming languages, back in 1993 there was a clear demand for some of the functional programming features listed above.&lt;/p&gt;
&lt;p&gt;In response, several functional tools were added to the language. According to &lt;a href=&quot;https://es.wikipedia.org/wiki/Guido_van_Rossum&quot;&gt;Guido van Rossum&lt;/a&gt;, they were contributed by a community member:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Python acquired &lt;code&gt;lambda&lt;/code&gt;, &lt;code&gt;reduce()&lt;/code&gt;, &lt;code&gt;filter()&lt;/code&gt; and &lt;code&gt;map()&lt;/code&gt;, courtesy of (I believe) a Lisp hacker who missed them and submitted working patches. (&lt;a href=&quot;http://www.artima.com/weblogs/viewpost.jsp?thread=98196&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Over the years, new features such as &lt;a href=&quot;https://realpython.com/list-comprehension-python/&quot;&gt;list comprehensions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/introduction-to-python-generators/&quot;&gt;generator expressions&lt;/a&gt;, and built-in functions like &lt;code&gt;sum()&lt;/code&gt;, &lt;code&gt;min()&lt;/code&gt;, &lt;code&gt;max()&lt;/code&gt;, &lt;code&gt;all()&lt;/code&gt;, and &lt;code&gt;any()&lt;/code&gt; were viewed as &lt;a href=&quot;https://realpython.com/learning-paths/writing-pythonic-code/&quot;&gt;Pythonic&lt;/a&gt; replacements for &lt;code&gt;map()&lt;/code&gt;, &lt;code&gt;filter()&lt;/code&gt;, and &lt;code&gt;reduce()&lt;/code&gt;. Guido &lt;a href=&quot;http://www.artima.com/weblogs/viewpost.jsp?thread=98196&quot;&gt;planned to remove&lt;/a&gt; &lt;code&gt;map()&lt;/code&gt;, &lt;code&gt;filter()&lt;/code&gt;, &lt;code&gt;reduce()&lt;/code&gt;, and even &lt;code&gt;lambda&lt;/code&gt; from the language in Python 3.&lt;/p&gt;
&lt;p&gt;Luckily, this removal didn’t take effect, mainly because the Python community didn’t want to let go of such popular features. They’re still around and still widely used among developers with a strong functional programming background.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll cover how to use Python’s &lt;code&gt;reduce()&lt;/code&gt; to process iterables and reduce them to a single cumulative value without using a &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;&lt;code&gt;for&lt;/code&gt; loop&lt;/a&gt;. You’ll also learn about some Python tools that you can use in place of &lt;code&gt;reduce()&lt;/code&gt; to make your code more Pythonic, readable, and efficient.&lt;/p&gt;
&lt;h2 id=&quot;getting-started-with-pythons-reduce&quot;&gt;Getting Started With Python’s &lt;code&gt;reduce()&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Python’s &lt;strong&gt;&lt;code&gt;reduce()&lt;/code&gt;&lt;/strong&gt; implements a mathematical technique commonly known as &lt;a href=&quot;https://en.wikipedia.org/wiki/Fold_(higher-order_function)&quot;&gt;&lt;strong&gt;folding&lt;/strong&gt;&lt;/a&gt; or &lt;strong&gt;reduction&lt;/strong&gt;. You’re doing a fold or reduction when you reduce a list of items to a single cumulative value. Python’s &lt;code&gt;reduce()&lt;/code&gt; operates on any &lt;a href=&quot;https://docs.python.org/3/glossary.html#term-iterable&quot;&gt;iterable&lt;/a&gt;—not just lists—and performs the following steps:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-reduce-function/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-reduce-function/ »&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 #15: Python Regular Expressions, Views vs Copies in Pandas, and More</title>
      <id>https://realpython.com/podcasts/rpp/15/</id>
      <link href="https://realpython.com/podcasts/rpp/15/"/>
      <updated>2020-06-26T12:00:00+00:00</updated>
      <summary>Have you wanted to learn Regular Expressions in Python, but don&#x27;t know where to start? Have you stumbled into the dreaded pink SettingWithCopyWarning in Pandas? This week on the show, we have David Amos from the Real Python team to discuss a recent two-part series on Regex in Python. We also talk about another recent article on the site about views vs copies in Pandas. David also brings a few other articles and projects from the wider Python community for us to discuss.</summary>
      <content type="html">
        &lt;p&gt;Have you wanted to learn Regular Expressions in Python, but don&#x27;t know where to start? Have you stumbled into the dreaded pink SettingWithCopyWarning in Pandas? This week on the show, we have David Amos from the Real Python team to discuss a recent two-part series on Regex in Python. We also talk about another recent article on the site about views vs copies in Pandas. David also brings a few other articles and projects from the wider Python community for us to discuss.&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 Python heapq Module: Using Heaps and Priority Queues</title>
      <id>https://realpython.com/python-heapq-module/</id>
      <link href="https://realpython.com/python-heapq-module/"/>
      <updated>2020-06-24T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll explore the heap and priority queue data structures. You&#x27;ll learn what kinds of problems heaps and priority queues are useful for and how you can use the Python heapq module to solve them.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;Heaps&lt;/strong&gt; and &lt;strong&gt;priority queues&lt;/strong&gt; are little-known but surprisingly useful data structures. For many problems that involve finding the best element in a dataset, they offer a solution that’s easy to use and highly effective. The Python &lt;code&gt;heapq&lt;/code&gt; module is part of the standard library. It implements all the low-level heap operations as well as some high-level common uses for heaps.&lt;/p&gt;
&lt;p&gt;A priority queue is a powerful tool that can solve problems as varied as writing an email scheduler, finding the shortest path on a map, or merging log files. Programming is full of &lt;a href=&quot;https://en.wikipedia.org/wiki/Optimization_problem&quot;&gt;optimization problems&lt;/a&gt; in which the goal is to find the best element. Priority queues and the functions in the Python &lt;code&gt;heapq&lt;/code&gt; module can often help with that.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;heaps&lt;/strong&gt; and &lt;strong&gt;priority queues&lt;/strong&gt; are and how they relate to each other&lt;/li&gt;
&lt;li&gt;What kinds of &lt;strong&gt;problems&lt;/strong&gt; can be solved using a heap&lt;/li&gt;
&lt;li&gt;How to use the Python &lt;strong&gt;&lt;code&gt;heapq&lt;/code&gt; module&lt;/strong&gt; to solve those problems&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This tutorial is for Pythonistas who are comfortable with &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;lists&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dicts&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-sets/&quot;&gt;sets&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/introduction-to-python-generators/&quot;&gt;generators&lt;/a&gt; and are looking for more sophisticated data structures.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-tricks-sample-pdf/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-tricks-sample-pdf&quot; data-focus=&quot;false&quot;&gt;Get a sample chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python&#x27;s best practices with simple examples you can apply instantly to write more beautiful + Pythonic code.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;what-are-heaps&quot;&gt;What Are Heaps?&lt;/h2&gt;
&lt;p&gt;Heaps are &lt;strong&gt;concrete&lt;/strong&gt; data structures, whereas priority queues are &lt;strong&gt;abstract&lt;/strong&gt; data structures. An abstract data structure determines the &lt;a href=&quot;https://realpython.com/python-interface/&quot;&gt;interface&lt;/a&gt;, while a concrete data structure defines the implementation. &lt;/p&gt;
&lt;p&gt;Heaps are commonly used to implement priority queues. They’re the most popular concrete data structure for implementing the priority queue abstract data structure.&lt;/p&gt;
&lt;p&gt;Concrete data structures also specify &lt;strong&gt;performance guarantees&lt;/strong&gt;. Performance guarantees define the relationship between the &lt;em&gt;size&lt;/em&gt; of the structure and the &lt;em&gt;time&lt;/em&gt; operations take. Understanding those guarantees allows you to predict how much time the program will take as the size of its inputs change.&lt;/p&gt;
&lt;h3 id=&quot;data-structures-heaps-and-priority-queues&quot;&gt;Data Structures, Heaps, and Priority Queues&lt;/h3&gt;
&lt;p&gt;Abstract data structures specify operations and the relationships between them. The priority queue abstract data structure, for example, supports three operations:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;is_empty&lt;/strong&gt; checks whether the queue is empty.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;add_element&lt;/strong&gt; adds an element to the queue.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pop_element&lt;/strong&gt; pops the element with the highest priority.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Priority queues are commonly used for optimizing task execution, in which the goal is to work on the task with the highest priority. After a task is completed, its priority is lowered, and it’s returned to the queue.&lt;/p&gt;
&lt;p&gt;There are two different conventions for determining the priority of an element:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The &lt;em&gt;largest&lt;/em&gt; element has the highest priority.&lt;/li&gt;
&lt;li&gt;The &lt;em&gt;smallest&lt;/em&gt; element has the highest priority.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;These two conventions are equivalent because you can always reverse the effective order. For example, if your elements consist of numbers, then using negative numbers will flip the conventions around.&lt;/p&gt;
&lt;p&gt;The Python &lt;code&gt;heapq&lt;/code&gt; module uses the second convention, which is generally the more common of the two. Under this convention, the &lt;em&gt;smallest&lt;/em&gt; element has the highest priority. This might sound surprising, but it’s often quite useful. In the real-life examples you’ll see later, this convention will simplify your code.&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 Python &lt;code&gt;heapq&lt;/code&gt; module, and the heap data structure in general, is &lt;em&gt;not&lt;/em&gt; designed to allow finding any element except the smallest one. For retrieval of any element by size, a better option is a &lt;a href=&quot;https://realpython.com/binary-search-python/&quot;&gt;binary search tree&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Concrete data structures implement the operations defined in an abstract data structure and further specify performance guarantees.&lt;/p&gt;
&lt;p&gt;The heap implementation of the priority queue guarantees that both pushing (adding) and popping (removing) elements are &lt;strong&gt;logarithmic time&lt;/strong&gt; operations. This means that the time it takes to do push and pop is proportional to the &lt;strong&gt;base-2 logarithm&lt;/strong&gt; of the number of elements.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Logarithm&quot;&gt;Logarithms&lt;/a&gt; grow slowly. The base-2 logarithm of fifteen is about four, while the base-2 logarithm of a trillion is about forty. This means that if an algorithm is fast enough on fifteen elements, then it’s going to be only ten times slower on a trillion elements and will probably still be fast enough.&lt;/p&gt;
&lt;p&gt;In any discussion of performance, the biggest caveat is that these abstract considerations are less meaningful than actually measuring a concrete program and learning where the &lt;a href=&quot;https://en.wikipedia.org/wiki/Bottleneck_(software)&quot;&gt;bottlenecks&lt;/a&gt; are. General performance guarantees are still important for making useful predictions about program behavior, but those predictions should be confirmed.&lt;/p&gt;
&lt;h3 id=&quot;implementation-of-heaps&quot;&gt;Implementation of Heaps&lt;/h3&gt;
&lt;p&gt;A heap implements a priority queue as a &lt;strong&gt;complete binary tree&lt;/strong&gt;. In a &lt;a href=&quot;https://en.wikipedia.org/wiki/Binary_tree&quot;&gt;binary tree&lt;/a&gt;, each node will have at most two children. In a &lt;em&gt;complete&lt;/em&gt; binary tree, all levels except possibly the deepest one are full at all times. If the deepest level is incomplete, then it will have the nodes as far to the left as possible. &lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-heapq-module/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-heapq-module/ »&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>Creating a Discord Bot in Python</title>
      <id>https://realpython.com/courses/discord-bot-python/</id>
      <link href="https://realpython.com/courses/discord-bot-python/"/>
      <updated>2020-06-23T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to make a Discord bot in Python and interact with several APIs. You&#x27;ll learn how to handle events, accept commands, validate and verify input, and all the basics that can help you create useful and exciting automations!</summary>
      <content type="html">
        &lt;p&gt;In a world where video games are so important to so many people, &lt;strong&gt;communication&lt;/strong&gt; and &lt;strong&gt;community&lt;/strong&gt; around games are vital. Discord offers both of those and more in one well-designed package. In this course, you&amp;rsquo;ll learn how to make a Discord bot in Python so that you can make the most of this fantastic platform.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;Discord&lt;/strong&gt; is and why it&amp;rsquo;s so valuable&lt;/li&gt;
&lt;li&gt;How to make a Discord bot through the &lt;strong&gt;Developer Portal&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to create &lt;strong&gt;Discord connections&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to handle &lt;strong&gt;events&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to accept &lt;strong&gt;commands&lt;/strong&gt; and &lt;strong&gt;validate assumptions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to interact with various &lt;strong&gt;Discord APIs&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>Hands-On Linear Programming: Optimization With Python</title>
      <id>https://realpython.com/linear-programming-python/</id>
      <link href="https://realpython.com/linear-programming-python/"/>
      <updated>2020-06-22T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn about implementing optimization in Python with linear programming libraries. Linear programming is one of the fundamental mathematical optimization techniques. You&#x27;ll use SciPy and PuLP to solve linear programming problems.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Linear_programming&quot;&gt;&lt;strong&gt;Linear programming&lt;/strong&gt;&lt;/a&gt; is a set of techniques used in &lt;a href=&quot;https://en.wikipedia.org/wiki/Mathematical_optimization&quot;&gt;&lt;strong&gt;mathematical programming&lt;/strong&gt;&lt;/a&gt;, sometimes called mathematical optimization, to solve &lt;a href=&quot;https://en.wikipedia.org/wiki/System_of_linear_equations&quot;&gt;systems of linear equations&lt;/a&gt; and inequalities while maximizing or minimizing some &lt;a href=&quot;https://en.wikipedia.org/wiki/Linear_function&quot;&gt;linear function&lt;/a&gt;. It’s important in fields like scientific computing, economics, technical sciences, manufacturing, transportation, military, management, energy, and so on.&lt;/p&gt;
&lt;p&gt;The Python ecosystem offers several comprehensive and powerful tools for linear programming. You can choose between simple and complex tools as well as between free and commercial ones. It all depends on your needs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;linear programming&lt;/strong&gt; is and why it’s important&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;Python tools&lt;/strong&gt; are suitable for linear programming&lt;/li&gt;
&lt;li&gt;How to build a linear programming &lt;strong&gt;model&lt;/strong&gt; in Python&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;solve&lt;/strong&gt; a linear programming problem with Python&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll first learn about the &lt;a href=&quot;https://brilliant.org/wiki/linear-programming/&quot;&gt;fundamentals&lt;/a&gt; of linear programming. Then you’ll explore how to implement linear programming techniques in Python. Finally, you’ll look at resources and libraries to help further your linear programming journey.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-mastery-course/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mastery-course&quot; data-focus=&quot;false&quot;&gt;5 Thoughts On Python Mastery&lt;/a&gt;, a free course for Python developers that shows you the roadmap and the mindset you&#x27;ll need to take your Python skills to the next level.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;linear-programming-explanation&quot;&gt;Linear Programming Explanation&lt;/h2&gt;
&lt;p&gt;In this section, you’ll learn the basics of linear programming and a related discipline, mixed-integer linear programming. In the &lt;a href=&quot;#linear-programming-examples&quot;&gt;next section&lt;/a&gt;, you’ll see some practical linear programming examples. Later, you’ll solve linear programming and mixed-integer linear programming problems with Python.&lt;/p&gt;
&lt;h3 id=&quot;what-is-linear-programming&quot;&gt;What Is Linear Programming?&lt;/h3&gt;
&lt;p&gt;Imagine that you have a system of linear equations and inequalities. Such systems often have many possible solutions. Linear programming is a set of mathematical and computational tools that allows you to find a particular solution to this system that corresponds to the maximum or minimum of some other linear function.&lt;/p&gt;
&lt;h3 id=&quot;what-is-mixed-integer-linear-programming&quot;&gt;What Is Mixed-Integer Linear Programming?&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Mixed-integer linear programming&lt;/strong&gt; is an extension of linear programming. It handles problems in which at least one variable takes a discrete integer rather than a &lt;a href=&quot;https://en.wikipedia.org/wiki/Continuous_or_discrete_variable&quot;&gt;continuous value&lt;/a&gt;. Although mixed-integer problems look similar to continuous variable problems at first sight, they offer significant advantages in terms of flexibility and precision.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Integer variables&lt;/strong&gt; are important for properly representing quantities naturally expressed with integers, like the number of airplanes produced or the number of customers served. &lt;/p&gt;
&lt;p&gt;A particularly important kind of integer variable is the &lt;strong&gt;binary variable&lt;/strong&gt;. It can take only the values &lt;strong&gt;zero&lt;/strong&gt; or &lt;strong&gt;one&lt;/strong&gt; and is useful in making yes-or-no decisions, such as whether a plant should be built or if a machine should be turned on or off. You can also use them to mimic logical constraints.&lt;/p&gt;
&lt;h3 id=&quot;why-is-linear-programming-important&quot;&gt;Why Is Linear Programming Important?&lt;/h3&gt;
&lt;p&gt;Linear programming is a fundamental optimization technique that’s been used for decades in science- and math-intensive fields. It’s precise, relatively fast, and suitable for a range of practical applications.&lt;/p&gt;
&lt;p&gt;Mixed-integer linear programming allows you to overcome many of the limitations of linear programming. You can approximate non-linear functions with &lt;a href=&quot;https://en.wikipedia.org/wiki/Piecewise_linear_function&quot;&gt;piecewise linear functions&lt;/a&gt;, use &lt;a href=&quot;http://lpsolve.sourceforge.net/5.0/semi-cont.htm&quot;&gt;semi-continuous variables&lt;/a&gt;, model logical constraints, and more. It’s a computationally intensive tool, but the advances in computer hardware and software make it more applicable every day.&lt;/p&gt;
&lt;p&gt;Often, when people try to formulate and solve an optimization problem, the first question is whether they can apply linear programming or mixed-integer linear programming.&lt;/p&gt;
&lt;p&gt;Some use cases of linear programming and mixed-integer linear programming are illustrated in the following articles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.gurobi.com/resources/?category-filter=case-study&quot;&gt;Gurobi Optimization Case Studies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://sciencing.com/five-application-linear-programming-techniques-7789072.html&quot;&gt;Five Areas of Application for Linear Programming Techniques&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The importance of linear programming, and especially mixed-integer linear programming, has increased over time as computers have gotten more capable, algorithms have improved, and more user-friendly software solutions have become available.&lt;/p&gt;
&lt;h3 id=&quot;linear-programming-with-python&quot;&gt;Linear Programming With Python&lt;/h3&gt;
&lt;p&gt;The basic method for solving linear programming problems is called the &lt;a href=&quot;https://en.wikipedia.org/wiki/Simplex_algorithm&quot;&gt;&lt;strong&gt;simplex method&lt;/strong&gt;&lt;/a&gt;, which has several variants. Another popular approach is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Interior-point_method&quot;&gt;&lt;strong&gt;interior-point method&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Mixed-integer linear programming problems are solved with more complex and computationally intensive methods like the &lt;a href=&quot;https://en.wikipedia.org/wiki/Branch_and_bound&quot;&gt;&lt;strong&gt;branch-and-bound method&lt;/strong&gt;&lt;/a&gt;, which uses linear programming under the hood. Some variants of this method are the &lt;a href=&quot;https://en.wikipedia.org/wiki/Branch_and_cut&quot;&gt;&lt;strong&gt;branch-and-cut method&lt;/strong&gt;&lt;/a&gt;, which involves the use of &lt;a href=&quot;https://en.wikipedia.org/wiki/Cutting-plane_method&quot;&gt;cutting planes&lt;/a&gt;, and the &lt;a href=&quot;https://en.wikipedia.org/wiki/Branch_and_price&quot;&gt;&lt;strong&gt;branch-and-price method&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are several suitable and well-known Python tools for linear programming and mixed-integer linear programming. Some of them are open source, while others are proprietary. Whether you need a free or paid tool depends on the size and complexity of your problem as well as on the need for speed and flexibility.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/linear-programming-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/linear-programming-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #14: Going Serverless with Python</title>
      <id>https://realpython.com/podcasts/rpp/14/</id>
      <link href="https://realpython.com/podcasts/rpp/14/"/>
      <updated>2020-06-19T12:00:00+00:00</updated>
      <summary>Would you like to run your Python code in the cloud without having to become an infrastructure engineer? Do you want to have Python functions that run when triggered by specific events? This week on the show we have Anthony Chu to discuss serverless computing and running python functions in the cloud. Anthony Chu is program manager for Microsoft&#x27;s Azure Functions.</summary>
      <content type="html">
        &lt;p&gt;Would you like to run your Python code in the cloud without having to become an infrastructure engineer? Do you want to have Python functions that run when triggered by specific events? This week on the show we have Anthony Chu to discuss serverless computing and running python functions in the cloud. Anthony Chu is program manager for Microsoft&#x27;s Azure Functions.&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>PySimpleGUI: The Simple Way to Create a GUI With Python</title>
      <id>https://realpython.com/pysimplegui-python/</id>
      <link href="https://realpython.com/pysimplegui-python/"/>
      <updated>2020-06-17T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn how to create a cross-platform graphical user interface (GUI) using Python and PySimpleGUI. A graphical user interface is an application that has buttons, windows, and lots of other elements that the user can use to interact with your application.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Creating a simple graphical user interface (GUI) that works across multiple platforms can be complicated. But it doesn’t have to be that way. You can use Python and the PySimpleGUI package to create nice-looking user interfaces that you and your users will enjoy! PySimpleGUI is a new Python GUI library that has been gaining a lot of interest recently.&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;&lt;strong&gt;Install&lt;/strong&gt; the PySimpleGUI package&lt;/li&gt;
&lt;li&gt;Create basic &lt;strong&gt;user interface&lt;/strong&gt; elements with PySimpleGUI&lt;/li&gt;
&lt;li&gt;Create applications, such as a PySimpleGUI &lt;strong&gt;image viewer&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Integrate PySimpleGUI with &lt;strong&gt;Matplotlib&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;computer vision&lt;/strong&gt; in PySimpleGUI&lt;/li&gt;
&lt;li&gt;Package your PySimpleGUI application for &lt;strong&gt;Windows&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now it’s time to get started!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-cheat-sheet-experiment&quot; data-focus=&quot;false&quot;&gt;Click here to get our free Python Cheat Sheet&lt;/a&gt; that shows you the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;getting-started-with-pysimplegui&quot;&gt;Getting Started With PySimpleGUI&lt;/h2&gt;
&lt;p&gt;PySimpleGUI was launched in 2018, so it’s a relatively new package compared with the likes of &lt;a href=&quot;https://realpython.com/python-gui-with-wxpython/&quot;&gt;wxPython&lt;/a&gt; or &lt;a href=&quot;https://realpython.com/python-pyqt-gui-calculator/&quot;&gt;PyQt&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;PySimpleGUI has four ports:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.python.org/3/library/tkinter.html&quot;&gt;Tkinter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://riverbankcomputing.com/software/pyqt/intro&quot;&gt;PyQt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.wxpython.org/pages/overview/&quot;&gt;wxPython&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://pypi.org/project/remi/&quot;&gt;Remi&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;PySimpleGUI wraps portions of each of these other packages and makes them easier to use. However, each of the ports has to be installed separately.&lt;/p&gt;
&lt;p&gt;PySimpleGUI wraps the entirety of Tkinter, which comes with Python. PySimpleGUI has wrapped most of PySide2, but only a small portion of wxPython. When you install PySimpleGUI, you get the &lt;strong&gt;Tkinter&lt;/strong&gt; variant by default. For more information about Tkinter, check out &lt;a href=&quot;https://realpython.com/python-gui-tkinter/&quot;&gt;Python GUI Programming With Tkinter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Depending on which variant of PySimpleGUI you use, applications that you create with PySimpleGUI may not look native to their platform. But don’t let this stop you from giving PySimpleGUI a try. PySimpleGUI is still quite powerful and can get most things done with a little work.&lt;/p&gt;
&lt;h2 id=&quot;installing-pysimplegui&quot;&gt;Installing PySimpleGUI&lt;/h2&gt;
&lt;p&gt;Installing PySimpleGUI is easy if you use &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;pip&lt;/a&gt;. For the purposes of this tutorial, you’ll learn how to install the regular PySimpleGUI port, which is the Tkinter variant.&lt;/p&gt;
&lt;p&gt;Here’s how to do it:&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 -m pip install pysimplegui
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This will install PySimpleGUI to whatever your system Python is set to. You can also install PySimpleGUI to a Python virtual environment. If you’re unfamiliar with Python virtual environments, then you should read &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;Python Virtual Environments: A Primer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you prefer to try the PyQt variant, then you can use &lt;code&gt;pip install PySimpleGUIQt&lt;/code&gt; instead. Now that you have PySimpleGUI installed, it’s time to find out how to use it!&lt;/p&gt;
&lt;h2 id=&quot;creating-basic-ui-elements-in-pysimplegui&quot;&gt;Creating Basic UI Elements in PySimpleGUI&lt;/h2&gt;
&lt;p&gt;If you’ve ever used a GUI toolkit before, then you may have heard the term &lt;strong&gt;widgets&lt;/strong&gt;. A widget is a generic term used to describe the elements that make up the user interface (UI), such as buttons, labels, windows, and more. In PySimpleGUI, widgets are referred to as &lt;strong&gt;elements&lt;/strong&gt;, which you may sometimes see capitalized elsewhere as &lt;strong&gt;Elements&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;One of the basic building blocks of PySimpleGUI is the &lt;code&gt;Window()&lt;/code&gt;. To create a &lt;code&gt;Window()&lt;/code&gt;, you can do the following:&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;# hello_world.py&lt;/span&gt;

&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;PySimpleGUI&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;sg&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;sg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[[]],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;margins&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;50&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;read&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;&lt;code&gt;Window()&lt;/code&gt; takes lots of different arguments—too many to be listed here. However, for this example you can give the &lt;code&gt;Window()&lt;/code&gt; a &lt;code&gt;title&lt;/code&gt; and a &lt;code&gt;layout&lt;/code&gt; and set the &lt;code&gt;margins&lt;/code&gt;, which is how big the UI window will be in pixels.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;read()&lt;/code&gt; returns any events that are triggered in the &lt;code&gt;Window()&lt;/code&gt; as a &lt;a href=&quot;https://realpython.com/python-data-types/#strings&quot;&gt;string&lt;/a&gt; as well as a &lt;code&gt;values&lt;/code&gt; &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionary&lt;/a&gt;. You’ll learn more about these in later sections of this tutorial.&lt;/p&gt;
&lt;p&gt;When you run this code, you should see something like this:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/pysimplegui-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/pysimplegui-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 Generators 101</title>
      <id>https://realpython.com/courses/python-generators/</id>
      <link href="https://realpython.com/courses/python-generators/"/>
      <updated>2020-06-16T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn about generators and yielding in Python. You&#x27;ll create generator functions and generator expressions using multiple Python yield statements. You&#x27;ll also learn how to build data pipelines that take advantage of these Pythonic tools.</summary>
      <content type="html">
        &lt;p&gt;Have you ever had to work with a dataset so large that it overwhelmed your machine&amp;rsquo;s memory? Or maybe you have a complex function that needs to maintain an internal state every time it&amp;rsquo;s called, but the function is too small to justify creating its own class. In these cases and more, &lt;strong&gt;generators&lt;/strong&gt; and the Python &lt;strong&gt;&lt;code&gt;yield&lt;/code&gt;&lt;/strong&gt; statement are here to help. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll know:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;generators&lt;/strong&gt; are and how to use them&lt;/li&gt;
&lt;li&gt;How to create &lt;strong&gt;generator functions and expressions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How the &lt;strong&gt;Python &lt;code&gt;yield&lt;/code&gt;&lt;/strong&gt; statement works&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;multiple&lt;/strong&gt; Python &lt;code&gt;yield&lt;/code&gt; statements in a generator function&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;advanced generator methods&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;build data pipelines&lt;/strong&gt; with multiple generators&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you’re a beginner or intermediate Pythonista and you’re interested in learning how to work with large datasets in a more Pythonic way, then this is the course 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 Keywords: An Introduction</title>
      <id>https://realpython.com/python-keywords/</id>
      <link href="https://realpython.com/python-keywords/"/>
      <updated>2020-06-15T14:00:00+00:00</updated>
      <summary>Python keywords make up the fundamental building blocks of any Python program. In this tutorial, you&#x27;ll learn the basic syntax and usage for each of Python&#x27;s thirty-five keywords so you can write more efficient and readable code.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Every programming language has special reserved words, or &lt;strong&gt;keywords&lt;/strong&gt;, that have specific meanings and restrictions around how they should be used. Python is no different. Python keywords are the fundamental building blocks of any Python program. &lt;/p&gt;
&lt;p&gt;In this article, you’ll find a basic introduction to all Python keywords along with other resources that will be helpful for learning more about each keyword.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this article, you’ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Identify&lt;/strong&gt; Python keywords&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Understand&lt;/strong&gt; what each keyword is used for&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Work&lt;/strong&gt; with keywords programmatically using the &lt;code&gt;keyword&lt;/code&gt; module&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-mastery-course/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mastery-course&quot; data-focus=&quot;false&quot;&gt;5 Thoughts On Python Mastery&lt;/a&gt;, a free course for Python developers that shows you the roadmap and the mindset you&#x27;ll need to take your Python skills to the next level.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;python-keywords&quot;&gt;Python Keywords&lt;/h2&gt;
&lt;p&gt;Python keywords are special reserved words that have specific meanings and purposes and can’t be used for anything but those specific purposes. These keywords are always available—you’ll never have to import them into your code.&lt;/p&gt;
&lt;p&gt;Python keywords are different from Python’s &lt;a href=&quot;https://docs.python.org/3/library/functions.html&quot;&gt;built-in functions and types&lt;/a&gt;. The built-in functions and types are also always available, but they aren’t as restrictive as the keywords in their usage. &lt;/p&gt;
&lt;p&gt;An example of something you &lt;em&gt;can’t&lt;/em&gt; do with Python keywords is assign something to them. If you try, then you’ll get a &lt;code&gt;SyntaxError&lt;/code&gt;. You won’t get a &lt;code&gt;SyntaxError&lt;/code&gt; if you try to assign something to a built-in function or type, but it still isn’t a good idea. For a more in-depth explanation of ways keywords can be misused, check out &lt;a href=&quot;https://realpython.com/invalid-syntax-python/#misspelling-missing-or-misusing-python-keywords&quot;&gt;Invalid Syntax in Python: Common Reasons for SyntaxError&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As of Python 3.8, there are &lt;a href=&quot;https://docs.python.org/3.8/reference/lexical_analysis.html#keywords&quot;&gt;thirty-five keywords&lt;/a&gt; in Python. Here they are with links to the relevant sections throughout the rest of this article:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table&quot;&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;a href=&quot;#the-true-and-false-keywords&quot;&gt;&lt;code&gt;False&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-await-keyword&quot;&gt;&lt;code&gt;await&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-else-keyword&quot;&gt;&lt;code&gt;else&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-import-keyword&quot;&gt;&lt;code&gt;import&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-pass-keyword&quot;&gt;&lt;code&gt;pass&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;a href=&quot;#the-none-keyword&quot;&gt;&lt;code&gt;None&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-break-keyword&quot;&gt;&lt;code&gt;break&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-except-keyword&quot;&gt;&lt;code&gt;except&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-in-keyword&quot;&gt;&lt;code&gt;in&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-raise-keyword&quot;&gt;&lt;code&gt;raise&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;a href=&quot;#the-true-and-false-keywords&quot;&gt;&lt;code&gt;True&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-class-keyword&quot;&gt;&lt;code&gt;class&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-finally-keyword&quot;&gt;&lt;code&gt;finally&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-is-keyword&quot;&gt;&lt;code&gt;is&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-return-keyword&quot;&gt;&lt;code&gt;return&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;a href=&quot;#the-and-keyword&quot;&gt;&lt;code&gt;and&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-continue-keyword&quot;&gt;&lt;code&gt;continue&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-for-keyword&quot;&gt;&lt;code&gt;for&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-lambda-keyword&quot;&gt;&lt;code&gt;lambda&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-try-keyword&quot;&gt;&lt;code&gt;try&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;a href=&quot;#the-as-keyword&quot;&gt;&lt;code&gt;as&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-def-keyword&quot;&gt;&lt;code&gt;def&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-from-keyword&quot;&gt;&lt;code&gt;from&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-nonlocal-keyword&quot;&gt;&lt;code&gt;nonlocal&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-while-keyword&quot;&gt;&lt;code&gt;while&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;a href=&quot;#the-assert-keyword&quot;&gt;&lt;code&gt;assert&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-del-keyword&quot;&gt;&lt;code&gt;del&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-global-keyword&quot;&gt;&lt;code&gt;global&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-not-keyword&quot;&gt;&lt;code&gt;not&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-with-keyword&quot;&gt;&lt;code&gt;with&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;a href=&quot;#the-async-keyword&quot;&gt;&lt;code&gt;async&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-elif-keyword&quot;&gt;&lt;code&gt;elif&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-if-keyword&quot;&gt;&lt;code&gt;if&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-or-keyword&quot;&gt;&lt;code&gt;or&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;&lt;a href=&quot;#the-yield-keyword&quot;&gt;&lt;code&gt;yield&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;You can use these links to jump to the keywords you’d like to read about, or you can continue reading for a guided tour.&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; Two keywords have additional uses beyond their initial use cases. The &lt;code&gt;else&lt;/code&gt; keyword is also &lt;a href=&quot;#the-else-keyword-used-with-loops&quot;&gt;used with loops&lt;/a&gt; as well as &lt;a href=&quot;#the-else-keyword-used-with-try-and-except&quot;&gt;with &lt;code&gt;try&lt;/code&gt; and &lt;code&gt;except&lt;/code&gt;&lt;/a&gt;. The &lt;code&gt;as&lt;/code&gt; keyword is also used &lt;a href=&quot;#the-as-keyword-used-with-with&quot;&gt;with the &lt;code&gt;with&lt;/code&gt; keyword&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;how-to-identify-python-keywords&quot;&gt;How to Identify Python Keywords&lt;/h2&gt;
&lt;p&gt;The list of Python keywords has changed over time. For example, the &lt;code&gt;await&lt;/code&gt; and &lt;code&gt;async&lt;/code&gt; keywords weren’t added until Python 3.7. Also, both &lt;code&gt;print&lt;/code&gt; and &lt;code&gt;exec&lt;/code&gt; were keywords in Python 2.7 but have been turned into built-in functions in Python 3+ and no longer appear in the list of keywords.&lt;/p&gt;
&lt;p&gt;In the sections below, you’ll learn several ways to know or find out which words are keywords in Python.&lt;/p&gt;
&lt;h3 id=&quot;use-an-ide-with-syntax-highlighting&quot;&gt;Use an IDE With Syntax Highlighting&lt;/h3&gt;
&lt;p&gt;There are a lot of &lt;a href=&quot;https://realpython.com/python-ides-code-editors-guide/&quot;&gt;good Python IDEs&lt;/a&gt; out there. All of them will highlight keywords to differentiate them from other words in your code. This will help you quickly identify Python keywords while you’re programming so you don’t use them incorrectly.&lt;/p&gt;
&lt;h3 id=&quot;use-code-in-a-repl-to-check-keywords&quot;&gt;Use Code in a REPL to Check Keywords&lt;/h3&gt;
&lt;p&gt;In the &lt;a href=&quot;https://realpython.com/interacting-with-python/#using-the-python-interpreter-interactively&quot;&gt;Python REPL&lt;/a&gt;, there are a number of ways you can identify valid Python keywords and learn more about them.  &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; Code examples in this article use Python 3.8 unless otherwise indicated.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You can get a list of available keywords by using &lt;code&gt;help()&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;help&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;keywords&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;Here is a list of the Python keywords.  Enter any keyword to get more help.&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;False               class               from                or&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;None                continue            global              pass&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;True                def                 if                  raise&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;and                 del                 import              return&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;as                  elif                in                  try&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;assert              else                is                  while&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;async               except              lambda              with&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;await               finally             nonlocal            yield&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;break               for                 not&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Next, as indicated in the output above, you can use &lt;code&gt;help()&lt;/code&gt; again by passing in the specific keyword that you need more information about. You can do this, for example, with the &lt;code&gt;pass&lt;/code&gt; keyword:&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;help&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;pass&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;The &quot;pass&quot; statement&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;********************&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;   pass_stmt ::= &quot;pass&quot;&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;&quot;pass&quot; is a null operation — when it is executed, nothing happens. It&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;is useful as a placeholder when a statement is required syntactically,&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;but no code needs to be executed, for example:&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;   def f(arg): pass    # a function that does nothing (yet)&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;   class C: pass       # a class with no methods (yet)&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-keywords/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-keywords/ »&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 #13: PDFs in Python and Projects on the Raspberry Pi</title>
      <id>https://realpython.com/podcasts/rpp/13/</id>
      <link href="https://realpython.com/podcasts/rpp/13/"/>
      <updated>2020-06-12T12:00:00+00:00</updated>
      <summary>Have you wanted to work with PDF files in Python? Maybe you want to extract text, merge and concatenate files, or even create PDFs from scratch. Are you interested in building hardware projects using a Raspberry Pi? This week on the show we have David Amos from the Real Python team to discuss his recent article on working with PDFs. David also brings a few other articles from the wider Python community for us to discuss.</summary>
      <content type="html">
        &lt;p&gt;Have you wanted to work with PDF files in Python? Maybe you want to extract text, merge and concatenate files, or even create PDFs from scratch. Are you interested in building hardware projects using a Raspberry Pi? This week on the show we have David Amos from the Real Python team to discuss his recent article on working with PDFs. David also brings a few other articles from the wider Python community for us to discuss.&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>Getting the Most Out of a Python Traceback</title>
      <id>https://realpython.com/courses/python-traceback/</id>
      <link href="https://realpython.com/courses/python-traceback/"/>
      <updated>2020-06-09T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn how to read and understand the information you can get from a Python stack traceback. You&#x27;ll walk through several examples and see some of the most common tracebacks in Python.</summary>
      <content type="html">
        &lt;p&gt;Python prints a &lt;strong&gt;traceback&lt;/strong&gt; when an &lt;strong&gt;exception&lt;/strong&gt; is raised in your code. The traceback output can be a bit overwhelming if you&amp;rsquo;re seeing it for the first time or you don&amp;rsquo;t know what it&amp;rsquo;s telling you. But the Python traceback has a wealth of information that can help you diagnose and fix the reason for the exception being raised in your code. Understanding what information a Python traceback provides is vital to becoming a better Python programmer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Make sense of the next traceback you see&lt;/li&gt;
&lt;li&gt;Recognize some of the more common tracebacks&lt;/li&gt;
&lt;li&gt;Log a traceback successfully while still handling the exception&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 #12: Web Scraping in Python: Tools, Techniques, and Legality</title>
      <id>https://realpython.com/podcasts/rpp/12/</id>
      <link href="https://realpython.com/podcasts/rpp/12/"/>
      <updated>2020-06-05T12:00:00+00:00</updated>
      <summary>Do you want to get started with web scraping using Python? Are you concerned about the potential legal implications? What are the tools required and what are some of the best practices? This week on the show we have Kimberly Fessel to discuss her excellent tutorial created for PyCon 2020 online titled &quot;It&#x27;s Officially Legal so Let&#x27;s Scrape the Web.&quot;</summary>
      <content type="html">
        &lt;p&gt;Do you want to get started with web scraping using Python? Are you concerned about the potential legal implications? What are the tools required and what are some of the best practices? This week on the show we have Kimberly Fessel to discuss her excellent tutorial created for PyCon 2020 online titled &quot;It&#x27;s Officially Legal so Let&#x27;s Scrape the Web.&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>Parallel Iteration With Python&#x27;s zip() Function</title>
      <id>https://realpython.com/courses/python-zip-function/</id>
      <link href="https://realpython.com/courses/python-zip-function/"/>
      <updated>2020-06-02T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to use the Python zip() function to solve common programming problems. You&#x27;ll learn how to traverse multiple iterables in parallel and create dictionaries with just a few lines of code.</summary>
      <content type="html">
        &lt;p&gt;Python&amp;rsquo;s &lt;strong&gt;&lt;code&gt;zip()&lt;/code&gt;&lt;/strong&gt; function creates an &lt;strong&gt;iterator&lt;/strong&gt; that will aggregate elements from two or more iterables. You can use the resulting iterator to quickly and consistently solve common programming problems, like creating dictionaries. In this course, you&amp;rsquo;ll discover the logic behind the Python &lt;code&gt;zip()&lt;/code&gt; function and how you can use it to solve real-world problems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How &lt;strong&gt;&lt;code&gt;zip()&lt;/code&gt;&lt;/strong&gt; works in both Python 3 and Python 2&lt;/li&gt;
&lt;li&gt;How to use the Python &lt;code&gt;zip()&lt;/code&gt; function for &lt;strong&gt;parallel iteration&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;create dictionaries&lt;/strong&gt; on the fly using &lt;code&gt;zip()&lt;/code&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 #11: Advice on Getting Started With Testing in Python</title>
      <id>https://realpython.com/podcasts/rpp/11/</id>
      <link href="https://realpython.com/podcasts/rpp/11/"/>
      <updated>2020-05-29T12:00:00+00:00</updated>
      <summary>Have you wanted to get started with testing in Python? Maybe you feel a little nervous about diving in deeper than just confirming your code runs. What are the tools needed and what would be the next steps to level up your Python testing? This week on the show we have Anthony Shaw to discuss his article on this subject. Anthony is a member of the Real Python team and has written several articles for the site.</summary>
      <content type="html">
        &lt;p&gt;Have you wanted to get started with testing in Python? Maybe you feel a little nervous about diving in deeper than just confirming your code runs. What are the tools needed and what would be the next steps to level up your Python testing? This week on the show we have Anthony Shaw to discuss his article on this subject. Anthony is a member of the Real Python team and has written several articles for the site.&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>A Beginner&#x27;s Guide to Pip</title>
      <id>https://realpython.com/courses/what-is-pip/</id>
      <link href="https://realpython.com/courses/what-is-pip/"/>
      <updated>2020-05-26T14:00:00+00:00</updated>
      <summary>What is pip? In this beginner-friendly course, you&#x27;ll learn how to use pip, the standard package manager for Python, so that you can install and manage additional packages that are not part of the Python standard library.</summary>
      <content type="html">
        &lt;p&gt;What is &lt;code&gt;pip&lt;/code&gt;? &lt;a href=&quot;https://pip.pypa.io/en/stable/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt; is the standard package manager for &lt;a href=&quot;https://www.python.org/&quot;&gt;Python&lt;/a&gt;. It allows you to install and manage additional packages that are not part of the &lt;a href=&quot;https://docs.python.org/3/py-modindex.html&quot;&gt;Python standard library&lt;/a&gt;. This course is an introduction to &lt;code&gt;pip&lt;/code&gt; for new Pythonistas.&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;Installing additional packages not included with the standard Python distribution&lt;/li&gt;
&lt;li&gt;Finding packages published to the &lt;a href=&quot;https://pypi.org/&quot;&gt;Python Package Index (PyPI)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Managing requirements for your scripts and applications&lt;/li&gt;
&lt;li&gt;Uninstalling packages and their dependencies&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you&amp;rsquo;ll see, the Python community is very active and has created some neat alternatives to &lt;code&gt;pip&lt;/code&gt; that you&amp;rsquo;ll learn about later in 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>The Real Python Podcast – Episode #10: Python Job Hunting in a Pandemic</title>
      <id>https://realpython.com/podcasts/rpp/10/</id>
      <link href="https://realpython.com/podcasts/rpp/10/"/>
      <updated>2020-05-22T12:00:00+00:00</updated>
      <summary>Do you know someone in the Python community who recently was let go from their job due to the pandemic? What does the job landscape currently look like? What are skills and techniques that will help you in your job search? This week we have Kyle Stratis on the show to discuss how he is managing his job search after just being let go from his data engineering job. Kyle is a member of the Real Python team and has written several articles for the site.</summary>
      <content type="html">
        &lt;p&gt;Do you know someone in the Python community who recently was let go from their job due to the pandemic? What does the job landscape currently look like? What are skills and techniques that will help you in your job search? This week we have Kyle Stratis on the show to discuss how he is managing his job search after just being let go from his data engineering job. Kyle is a member of the Real Python team and has written several articles for the site.&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>Convert a Python String to int</title>
      <id>https://realpython.com/courses/convert-python-string-int/</id>
      <link href="https://realpython.com/courses/convert-python-string-int/"/>
      <updated>2020-05-19T14:00:00+00:00</updated>
      <summary>There are several ways to represent integers in Python. In this quick and practical course, you&#x27;ll learn how you can store integers using int and str as well as how you can convert a Python string to an int and vice versa.</summary>
      <content type="html">
        &lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Integer&quot;&gt;&lt;strong&gt;Integers&lt;/strong&gt;&lt;/a&gt; are whole numbers. In other words, they have no fractional component. Two data types you can use to store an integer in Python are &lt;strong&gt;&lt;a href=&quot;https://realpython.com/python-data-types/#integers&quot;&gt;&lt;code&gt;int&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a href=&quot;https://realpython.com/python-data-types/#strings&quot;&gt;&lt;code&gt;str&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;. These types offer flexibility for working with integers in different circumstances. In this course, you&amp;rsquo;ll learn how you can convert a Python string to an &lt;code&gt;int&lt;/code&gt;. You&amp;rsquo;ll also learn how to convert an &lt;code&gt;int&lt;/code&gt; to a string.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll understand how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Store integers using &lt;code&gt;str&lt;/code&gt; and &lt;code&gt;int&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Convert a Python string to an &lt;code&gt;int&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Convert a Python &lt;code&gt;int&lt;/code&gt; to a string&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 #9: Leveling Up Your Python Literacy and Finding Python Projects to Study</title>
      <id>https://realpython.com/podcasts/rpp/9/</id>
      <link href="https://realpython.com/podcasts/rpp/9/"/>
      <updated>2020-05-15T12:00:00+00:00</updated>
      <summary>In your quest to become a better developer, how do you find Python code that is at your reading level? What are good code bases or projects to study? What are the things holding you back from leveling up your Python literacy? This week we have Cecil Phillip on the show to discuss all of these common questions. Cecil is a Senior Cloud Advocate at Microsoft.</summary>
      <content type="html">
        &lt;p&gt;In your quest to become a better developer, how do you find Python code that is at your reading level? What are good code bases or projects to study? What are the things holding you back from leveling up your Python literacy? This week we have Cecil Phillip on the show to discuss all of these common questions. Cecil is a Senior Cloud Advocate at Microsoft.&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>Improve Your Tests With the Python Mock Object Library</title>
      <id>https://realpython.com/courses/python-mock-object-library/</id>
      <link href="https://realpython.com/courses/python-mock-object-library/"/>
      <updated>2020-05-12T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to use the Python mock object library, unittest.mock, to create and use mock objects to improve your tests. Obstacles like complex logic and unpredictable dependencies make writing valuable tests difficult, but unittest.mock can help you overcome these obstacles.</summary>
      <content type="html">
        &lt;p&gt;When you&amp;rsquo;re writing robust code, &lt;strong&gt;tests&lt;/strong&gt; are essential for verifying that your application logic is correct, reliable, and efficient. However, the value of your tests depends on how well they demonstrate these criteria. Obstacles such as &lt;strong&gt;complex logic&lt;/strong&gt; and unpredictable &lt;strong&gt;dependencies&lt;/strong&gt; make writing valuable tests difficult. The Python mock object library, &lt;strong&gt;&lt;code&gt;unittest.mock&lt;/code&gt;&lt;/strong&gt;, can help you overcome these obstacles.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create Python mock objects using &lt;code&gt;Mock&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Assert that you&amp;rsquo;re using objects as you intended&lt;/li&gt;
&lt;li&gt;Inspect usage data stored on your Python mocks&lt;/li&gt;
&lt;li&gt;Configure certain aspects of your Python mock objects&lt;/li&gt;
&lt;li&gt;Substitute your mocks for real objects using &lt;code&gt;patch()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Avoid common problems inherent in Python mocking&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You&amp;rsquo;ll begin by seeing what mocking is and how it will improve your tests!&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>
