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

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

  
    <entry>
      <title>Django View Authorization: Restricting Access</title>
      <id>https://realpython.com/courses/django-view-authorization/</id>
      <link href="https://realpython.com/courses/django-view-authorization/"/>
      <updated>2021-03-09T14:00:00+00:00</updated>
      <summary>This course covers how to restrict your web pages to users with different roles through Django view authorization. You&#x27;ll learn about HttpRequest.user objects, view decorators that authenticate, and how to notify your users with the Django messages framework.</summary>
      <content type="html">
        &lt;p&gt;Django provides tools for both authentication and authorization. Django view authorization is typically done with &lt;strong&gt;decorators&lt;/strong&gt;. This course will show you how to use these view decorators to enforce authorized viewing of pages in your Django site.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course you&amp;rsquo;ll know how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;&lt;code&gt;HttpRequest&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;HttpRequest.user&lt;/code&gt;&lt;/strong&gt; objects&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authenticate&lt;/strong&gt; and &lt;strong&gt;authorize&lt;/strong&gt; users&lt;/li&gt;
&lt;li&gt;Differentiate between &lt;strong&gt;regular&lt;/strong&gt;, &lt;strong&gt;staff&lt;/strong&gt;, and &lt;strong&gt;admin&lt;/strong&gt; users&lt;/li&gt;
&lt;li&gt;Secure a view with the &lt;strong&gt;&lt;code&gt;@login_required&lt;/code&gt;&lt;/strong&gt; decorator&lt;/li&gt;
&lt;li&gt;Restrict a view to different roles with the &lt;strong&gt;&lt;code&gt;@user_passes_test&lt;/code&gt;&lt;/strong&gt; decorator&lt;/li&gt;
&lt;li&gt;Use the Django &lt;strong&gt;messages framework&lt;/strong&gt; to notify your users&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast: It&#x27;s Been a Year!</title>
      <id>https://realpython.com/real-python-podcast-first-year/</id>
      <link href="https://realpython.com/real-python-podcast-first-year/"/>
      <updated>2021-03-08T14:00:00+00:00</updated>
      <summary>The Real Python Podcast just reached a major milestone: its fiftieth episode! In this article, you&#x27;ll look at some of the awesome guests we&#x27;ve had and topics we&#x27;ve covered, and you&#x27;ll get a preview of the exciting things happening in the future.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;This week, the &lt;a href=&quot;https://realpython.com/podcasts/rpp/&quot;&gt;Real Python Podcast&lt;/a&gt; is reaching its &lt;a href=&quot;https://realpython.com/podcasts/rpp/50/&quot;&gt;fiftieth episode&lt;/a&gt;! &lt;/p&gt;
&lt;p&gt;It’s been quite a year, full of sharing and learning and connecting in the Python &lt;strong&gt;community&lt;/strong&gt;. We’re looking forward to bringing you more interesting guests, interviews with &lt;strong&gt;expert Pythonistas&lt;/strong&gt;, and lots of &lt;strong&gt;behind-the-scenes&lt;/strong&gt; with the &lt;em&gt;Real Python&lt;/em&gt; team.&lt;/p&gt;
&lt;p&gt;Here’s a quick look at some of what’s been going on with the podcast in the past year as well as a sneak peek at what’s to come!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-cheat-sheet-shortened&quot; data-focus=&quot;false&quot;&gt;Click here to get a Python Cheat Sheet&lt;/a&gt; and learn the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;pycon-speakers-shared-their-expertise&quot;&gt;PyCon Speakers Shared Their Expertise&lt;a class=&quot;headerlink&quot; href=&quot;#pycon-speakers-shared-their-expertise&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://realpython.com/pycon-guide/&quot;&gt;PyCon&lt;/a&gt; is an important hub for the Python community, so we absolutely had to bring you the experts who are sharing their expertise at this conference. Here are some of the speakers you heard from this past year:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/real-python-podcast-first-year/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/real-python-podcast-first-year/ »&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 #50: Consuming APIs With Python and Building Microservices With gRPC</title>
      <id>https://realpython.com/podcasts/rpp/50/</id>
      <link href="https://realpython.com/podcasts/rpp/50/"/>
      <updated>2021-03-05T12:00:00+00:00</updated>
      <summary>Have you wanted to get your Python code to consume data from web-based APIs? Maybe you&#x27;ve dabbled with the requests package, but you don&#x27;t know what steps to take next. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you wanted to get your Python code to consume data from web-based APIs? Maybe you&#x27;ve dabbled with the requests package, but you don&#x27;t know what steps to take next. This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>New Features: Article Bookmarks, Completion Status, and Search Improvements</title>
      <id>https://realpython.com/article-bookmarks-search-improvements/</id>
      <link href="https://realpython.com/article-bookmarks-search-improvements/"/>
      <updated>2021-03-03T14:00:00+00:00</updated>
      <summary>We&#x27;ve just launched out several new features to help you easily find and review the learning resources you&#x27;re looking for: article bookmarks, completion status tracking, and search improvements.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;With close to 2,000 Python tutorials and video lessons in the Real Python content library, it was getting harder and harder for learners to find the right  resources at the right time.&lt;/p&gt;
&lt;p&gt;To fix that, we’ve just launched out several new features to help you easily find and review the learning resources you’re looking for.&lt;/p&gt;
&lt;p&gt;Here’s what’s new:&lt;/p&gt;
&lt;h2 id=&quot;article-completion-status-and-bookmarks&quot;&gt;Article Completion Status and Bookmarks&lt;a class=&quot;headerlink&quot; href=&quot;#article-completion-status-and-bookmarks&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Just like with courses and course lessons, you can now &lt;strong&gt;bookmark written tutorials&lt;/strong&gt; and &lt;strong&gt;mark them as completed&lt;/strong&gt; to track your learning progress.&lt;/p&gt;
&lt;p&gt;This makes it super easy to save tutorials you want to read, or to keep tutorials you found valuable around for future reference:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/article-bookmarks-search-improvements/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/article-bookmarks-search-improvements/ »&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>Navigating Namespaces and Scope in Python</title>
      <id>https://realpython.com/courses/navigate-namespaces-scope/</id>
      <link href="https://realpython.com/courses/navigate-namespaces-scope/"/>
      <updated>2021-03-02T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn about Python namespaces, the structures used to store and organize the symbolic names created during execution of a Python program. You&#x27;ll learn when namespaces are created, how they are implemented, and how they define variable scope.</summary>
      <content type="html">
        &lt;p&gt;In a program of any complexity, you&amp;rsquo;ll create hundreds or thousands of names, each pointing to a specific object. How does Python keep track of all these names so that they don&amp;rsquo;t interfere with one another? This course covers Python namespaces, the structures used to organize the symbolic names assigned to objects in a Python program.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How Python organizes symbolic names and objects in &lt;strong&gt;namespaces&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;When Python creates a new namespace&lt;/li&gt;
&lt;li&gt;How namespaces are implemented&lt;/li&gt;
&lt;li&gt;How &lt;strong&gt;variable scope&lt;/strong&gt; determines symbolic name visibility&lt;/li&gt;
&lt;li&gt;What is the &lt;strong&gt;LEGB&lt;/strong&gt; rule&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python and MongoDB: Connecting to NoSQL Databases</title>
      <id>https://realpython.com/introduction-to-mongodb-and-python/</id>
      <link href="https://realpython.com/introduction-to-mongodb-and-python/"/>
      <updated>2021-03-01T16:59:25+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn how to use Python to interface with the NoSQL database system MongoDB. You&#x27;ll get an overview of the differences between SQL and NoSQL, and you&#x27;ll also learn about related tools, including PyMongo and MongoEngine.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;a href=&quot;https://www.mongodb.com/what-is-mongodb&quot;&gt;MongoDB&lt;/a&gt; is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Document-oriented_database&quot;&gt;document-oriented&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/NoSQL&quot;&gt;NoSQL&lt;/a&gt; database solution that provides great scalability and flexibility along with a powerful querying system. With MongoDB and Python, you can develop many different types of database applications quickly. So if your Python application needs a database that’s just as flexible as the language itself, then MongoDB is for you.&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;MongoDB&lt;/strong&gt; is&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;install and run&lt;/strong&gt; MongoDB&lt;/li&gt;
&lt;li&gt;How to work with &lt;strong&gt;MongoDB databases&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to use the low-level &lt;strong&gt;PyMongo driver&lt;/strong&gt; to interface with MongoDB&lt;/li&gt;
&lt;li&gt;How to use the high-level &lt;strong&gt;MongoEngine object-document mapper (ODM)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Throughout this tutorial, you’ll write a couple of examples that will demonstrate the flexibility and power of MongoDB and its great Python support. To download the source code for those examples, click the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get the Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-mongodb-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mongodb-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get the source code you’ll use&lt;/a&gt; to learn about using MongoDB with Python in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;using-sql-vs-nosql-databases&quot;&gt;Using SQL vs NoSQL Databases&lt;a class=&quot;headerlink&quot; href=&quot;#using-sql-vs-nosql-databases&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For decades, &lt;a href=&quot;https://en.wikipedia.org/wiki/SQL&quot;&gt;SQL&lt;/a&gt; databases were one of the only choices for developers looking to build large and scalable database systems. However, the increasing need for storing complex data structures led to the birth of &lt;strong&gt;NoSQL&lt;/strong&gt; databases. This new kind of database system allows developers to store heterogeneous and structureless data efficiently.&lt;/p&gt;
&lt;p&gt;In general, NoSQL database systems store and retrieve data in a much different way from SQL &lt;a href=&quot;https://en.wikipedia.org/wiki/Relational_database#RDBMS&quot;&gt;relational database management systems&lt;/a&gt; (RDBMSs).&lt;/p&gt;
&lt;p&gt;When it comes to choosing from the currently available database technologies, you might need to decide between using SQL or NoSQL systems. Both of them have specific features that you should consider when choosing one or the other. Here are some of their more substantial differences:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;SQL Databases&lt;/th&gt;
&lt;th&gt;NoSQL Databases&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Data model&lt;/td&gt;
&lt;td&gt;Relational&lt;/td&gt;
&lt;td&gt;Nonrelational&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Structure&lt;/td&gt;
&lt;td&gt;Table-based, with columns and rows&lt;/td&gt;
&lt;td&gt;Document based, key-value pairs, graph, or wide-column&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schema&lt;/td&gt;
&lt;td&gt;A predefined and strict schema in which every record (row) is of the same nature and possesses the same properties&lt;/td&gt;
&lt;td&gt;A dynamic schema or schemaless which means that records don’t need to be of the same nature&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Query language&lt;/td&gt;
&lt;td&gt;Structured Query Language (SQL)&lt;/td&gt;
&lt;td&gt;Varies from database to database&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scalability&lt;/td&gt;
&lt;td&gt;Vertical&lt;/td&gt;
&lt;td&gt;Horizontal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/ACID&quot;&gt;ACID&lt;/a&gt; transactions&lt;/td&gt;
&lt;td&gt;Supported&lt;/td&gt;
&lt;td&gt;Supported, depending on the specific NoSQL database&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ability to add new properties&lt;/td&gt;
&lt;td&gt;Need to alter the schema first&lt;/td&gt;
&lt;td&gt;Possible without disturbing anything&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;There are many other differences between the two types of databases, but those mentioned above are some of the more important ones to know about.&lt;/p&gt;
&lt;p&gt;When choosing a database, you should consider its strengths and weaknesses carefully. You also need to consider how the database fits into your specific scenario and your application’s requirements. Sometimes the right solution is to use a combination of SQL and NoSQL databases to handle different aspects of a broader system.&lt;/p&gt;
&lt;p&gt;Some common examples of SQL databases include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.sqlite.org/docs.html&quot;&gt;SQLite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.xplenty.com/integrations/mysql/&quot;&gt;MySQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.xplenty.com/integrations/oracle/&quot;&gt;Oracle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.xplenty.com/integrations/postgresql/&quot;&gt;PostgreSQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.xplenty.com/integrations/microsoft-sql-server/&quot;&gt;Microsoft SQL Server&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;NoSQL database examples include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/dynamodb/&quot;&gt;DynamoDB&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://cassandra.apache.org/doc/latest/&quot;&gt;Cassandra&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-redis/&quot;&gt;Redis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://couchdb.apache.org/#about&quot;&gt;CouchDB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://rethinkdb.com/faq&quot;&gt;RethinkDB&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ravendb.net/about&quot;&gt;RavenDB&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.xplenty.com/integrations/mongodb/&quot;&gt;MongoDB&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In recent years, SQL and NoSQL databases have even begun to merge. For example, database systems, such as &lt;a href=&quot;https://www.postgresql.org/docs/9.2/datatype-json.html&quot;&gt;PostgreSQL&lt;/a&gt;, &lt;a href=&quot;https://dev.mysql.com/doc/refman/5.7/en/json.html&quot;&gt;MySQL&lt;/a&gt;, and &lt;a href=&quot;https://docs.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server?redirectedfrom=MSDN&amp;amp;view=sql-server-ver15&quot;&gt;Microsoft SQL Server&lt;/a&gt; now support storing and querying &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;JSON&lt;/a&gt; data, much like NoSQL databases. With this, you can now achieve many of the same results with both technologies. But you still don’t get many of the NoSQL features, such as horizontal scaling and the user-friendly interface.&lt;/p&gt;
&lt;p&gt;With this brief background on SQL and NoSQL databases, you can focus on the main topic of this tutorial: the &lt;strong&gt;MongoDB database&lt;/strong&gt; and how to use it in Python.&lt;/p&gt;
&lt;h2 id=&quot;managing-nosql-databases-with-mongodb&quot;&gt;Managing NoSQL Databases With MongoDB&lt;a class=&quot;headerlink&quot; href=&quot;#managing-nosql-databases-with-mongodb&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;MongoDB is a &lt;strong&gt;document-oriented&lt;/strong&gt; database classified as NoSQL. It’s become popular throughout the industry in recent years and integrates extremely well with Python. Unlike traditional SQL RDBMSs, MongoDB uses &lt;strong&gt;collections&lt;/strong&gt; of &lt;strong&gt;documents&lt;/strong&gt; instead of &lt;strong&gt;tables&lt;/strong&gt; of &lt;strong&gt;rows&lt;/strong&gt; to organize and store data.&lt;/p&gt;
&lt;p&gt;MongoDB stores data in schemaless and flexible JSON-like documents. Here, &lt;strong&gt;schemaless&lt;/strong&gt; means that you can have documents with a different set of &lt;a href=&quot;https://en.wikipedia.org/wiki/Field_(computer_science)&quot;&gt;fields&lt;/a&gt; in the same collection, without the need for satisfying a rigid table &lt;strong&gt;schema&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;You can change the structure of your documents and data over time, which results in a flexible system that allows you to quickly adapt to requirement changes without the need for a complex process of &lt;a href=&quot;https://en.wikipedia.org/wiki/Data_migration&quot;&gt;data migration&lt;/a&gt;. However, the trade-off in changing the structure of new documents is that exiting documents become inconsistent with the updated schema. So this is a topic that needs to be managed with care.&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; &lt;a href=&quot;https://en.wikipedia.org/wiki/JSON&quot;&gt;JSON&lt;/a&gt; stands for &lt;strong&gt;JavaScript Object Notation&lt;/strong&gt;. It’s a file format with a human-readable structure consisting of key-value pairs that can be nested arbitrarily deep.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;MongoDB is written in &lt;a href=&quot;https://realpython.com/python-vs-cpp/&quot;&gt;C++&lt;/a&gt; and actively &lt;a href=&quot;https://github.com/mongodb/mongo&quot;&gt;developed&lt;/a&gt; by &lt;a href=&quot;https://www.mongodb.com/company&quot;&gt;MongoDB Inc.&lt;/a&gt; It runs on all major platforms, such as macOS, Windows, Solaris, and most Linux distributions. In general, there are three main development goals behind the MongoDB database:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Scale well&lt;/li&gt;
&lt;li&gt;Store rich data structures&lt;/li&gt;
&lt;li&gt;Provide a sophisticated query mechanism&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/introduction-to-mongodb-and-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/introduction-to-mongodb-and-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 #49: The Challenges of Developing Into a Python Professional</title>
      <id>https://realpython.com/podcasts/rpp/49/</id>
      <link href="https://realpython.com/podcasts/rpp/49/"/>
      <updated>2021-02-26T12:00:00+00:00</updated>
      <summary>What&#x27;s the difference between writing code for yourself and developing for others? What new  considerations do you need to take into account as a professional Python developer? This week on the show, we talk to Dane Hillard about his book &quot;Practices of the Python Pro&quot;.</summary>
      <content type="html">
        &lt;p&gt;What&#x27;s the difference between writing code for yourself and developing for others? What new  considerations do you need to take into account as a professional Python developer? This week on the show, we talk to Dane Hillard about his book &quot;Practices of the Python Pro&quot;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Brython: Python in Your Browser</title>
      <id>https://realpython.com/brython-python-in-browser/</id>
      <link href="https://realpython.com/brython-python-in-browser/"/>
      <updated>2021-02-24T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to use Brython to run Python code in the browser. Although most front-end web applications are written in JavaScript, you can use Brython to access JavaScript libraries and APIs and deploy Python-based applications to the web.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you’re a web developer who prefers writing Python over JavaScript, then &lt;a href=&quot;https://brython.info/&quot;&gt;Brython&lt;/a&gt;, a Python implementation that runs in the browser, may be an appealing option.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript&quot;&gt;JavaScript&lt;/a&gt; is the de facto language of &lt;strong&gt;front-end web development&lt;/strong&gt;. Sophisticated JavaScript engines are an inherent part of all modern Internet browsers and naturally drive developers to code front-end web applications in JavaScript. &lt;strong&gt;Brython&lt;/strong&gt; offers the best of both worlds by making Python a first-class citizen language in the browser and by having access to all the existing JavaScript libraries and APIs available in the browser.&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 Brython&lt;/strong&gt; in your local environment&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;Python in a browser&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Write Python code that &lt;strong&gt;interacts with JavaScript&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Deploy &lt;strong&gt;Python with your web application&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Create &lt;strong&gt;browser extensions&lt;/strong&gt; with Python&lt;/li&gt;
&lt;li&gt;Compare Brython with &lt;strong&gt;other Python implementations&lt;/strong&gt; for web applications&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As an intermediate Python developer familiar with &lt;a href=&quot;https://realpython.com/learning-paths/become-python-web-developer/&quot;&gt;web development&lt;/a&gt;, you’ll get the most out of this tutorial if you also have some knowledge of &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Learn/HTML&quot;&gt;HTML&lt;/a&gt; and JavaScript. For a JavaScript refresher, check out &lt;a href=&quot;https://realpython.com/python-vs-javascript/&quot;&gt;Python vs JavaScript for Pythonistas&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can download the source material for the examples in this tutorial by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get the Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/brython-browser-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-brython-browser-python-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get the source code you’ll use&lt;/a&gt; to learn about using Brython to run Python in the browser in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;running-python-in-the-browser-the-benefits&quot;&gt;Running Python in the Browser: The Benefits&lt;a class=&quot;headerlink&quot; href=&quot;#running-python-in-the-browser-the-benefits&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Although JavaScript is the ubiquitous language of front-end web development, the following points may apply to you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You may not like writing code in JavaScript.&lt;/li&gt;
&lt;li&gt;You may want to leverage your Python skills.&lt;/li&gt;
&lt;li&gt;You may not want to spend the time to learn JavaScript to explore browser technologies.&lt;/li&gt;
&lt;li&gt;You may not like being forced to learn and use JavaScript to implement a web application.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whatever the reason, many developers would prefer a Python-based alternative to JavaScript for leveraging the power of the browser.&lt;/p&gt;
&lt;p&gt;There are several benefits of running Python in the browser. It allows you to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Execute the same Python code in the server and the browser&lt;/li&gt;
&lt;li&gt;Work with various &lt;a href=&quot;https://html.spec.whatwg.org/multipage/webappapis.html#webappapis&quot;&gt;browser APIs&lt;/a&gt; using Python&lt;/li&gt;
&lt;li&gt;Manipulate the Document Object Model (DOM) with Python&lt;/li&gt;
&lt;li&gt;Use Python to interact with existing JavaScript libraries like Vue.js and jQuery&lt;/li&gt;
&lt;li&gt;Teach the Python language to Python students with the Brython editor&lt;/li&gt;
&lt;li&gt;Keep the sense of fun while programming in Python&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One side effect of using Python in the browser is a loss of performance compared to the same code in JavaScript. However, this drawback doesn’t outweigh any of the benefits outlined above.&lt;/p&gt;
&lt;h3 id=&quot;implementing-isomorphic-web-development&quot;&gt;Implementing Isomorphic Web Development&lt;a class=&quot;headerlink&quot; href=&quot;#implementing-isomorphic-web-development&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Isomorphic_JavaScript&quot;&gt;Isomorphic JavaScript&lt;/a&gt;, or &lt;strong&gt;Universal JavaScript&lt;/strong&gt;, emphasizes that JavaScript applications should run on both the client and the server. This is assuming that the back end is JavaScript based, namely a &lt;a href=&quot;https://nodejs.org/en/&quot;&gt;Node&lt;/a&gt; server. Python developers using &lt;a href=&quot;https://realpython.com/learning-paths/flask-by-example/&quot;&gt;Flask&lt;/a&gt; or &lt;a href=&quot;https://realpython.com/tutorials/django/&quot;&gt;Django&lt;/a&gt; can also apply the principles of isomorphism to Python, provided that they can run Python in the browser. &lt;/p&gt;
&lt;p&gt;Brython allows you to build the front end in Python and share modules between the client and the server. For example, you can share validation functions, like the following code that normalizes and validates US phone numbers:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;linenos&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;re&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 2&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 3&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;normalize_us_phone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 4&lt;/span&gt;    &lt;span class=&quot;sd&quot;&gt;&quot;&quot;&quot;Extract numbers and digits from a given phone number&quot;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 5&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;[^\da-zA-z]&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 6&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 7&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;is_valid_us_phone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;bool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 8&lt;/span&gt;    &lt;span class=&quot;sd&quot;&gt;&quot;&quot;&quot;Validate 10-digit phone number&quot;&quot;&quot;&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 9&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;normalized_number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;normalize_us_phone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt;10&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;^\d&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{10}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;$&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;normalized_number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code&gt;normalize_us_phone()&lt;/code&gt; eliminates any nonalphanumeric characters, whereas &lt;code&gt;is_valid_us_phone()&lt;/code&gt; returns &lt;code&gt;True&lt;/code&gt; if the input string contains exactly ten digits and no alphabetic characters. The same code can be shared between processes running on a Python server and a client built with Brython.&lt;/p&gt;
&lt;h3 id=&quot;accessing-web-apis&quot;&gt;Accessing Web APIs&lt;a class=&quot;headerlink&quot; href=&quot;#accessing-web-apis&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Internet browsers expose standardized &lt;a href=&quot;https://html.spec.whatwg.org/multipage/webappapis.html&quot;&gt;web APIs&lt;/a&gt; to JavaScript. These standards are part of the &lt;a href=&quot;https://html.spec.whatwg.org/dev/&quot;&gt;HTML Living Standard&lt;/a&gt;. Some web API examples include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API&quot;&gt;Web Storage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API&quot;&gt;Web Crypto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API&quot;&gt;Web Workers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/History&quot;&gt;History&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/URL_API&quot;&gt;URL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Brython allows you to both use the web APIs and interact with JavaScript. You’ll work with some of the web APIs in &lt;a href=&quot;#interacting-with-javascript&quot;&gt;a later section&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;prototyping-and-javascript-libraries&quot;&gt;Prototyping and JavaScript Libraries&lt;a class=&quot;headerlink&quot; href=&quot;#prototyping-and-javascript-libraries&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Python is often used to prototype snippets of code, language constructs, or bigger ideas. With Brython, this common coding practice becomes available in your browser. For example, you can use the &lt;a href=&quot;https://brython.info/tests/console.html&quot;&gt;Brython console&lt;/a&gt; or the interactive &lt;a href=&quot;https://brython.info/tests/editor.html&quot;&gt;editor&lt;/a&gt; to experiment with a snippet of code. &lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/brython-python-in-browser/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/brython-python-in-browser/ »&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>Dictionaries and Arrays: Selecting the Ideal Data Structure</title>
      <id>https://realpython.com/courses/dicts-arrays-ideal-data-structure/</id>
      <link href="https://realpython.com/courses/dicts-arrays-ideal-data-structure/"/>
      <updated>2021-02-23T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn about two of Python&#x27;s data structures: dictionaries and arrays. You&#x27;ll look at multiple types and classes for both of these and learn which implementations are best for your specific use cases.</summary>
      <content type="html">
        &lt;p&gt;There are a variety of ways of storing and managing data in your Python programs, and the choice of the right data structure will affect the readability of your code, ease of writing, and performance. Python has a wide variety of built-in mechanisms that meet most of your data structure needs.&lt;/p&gt;
&lt;p&gt;This course introduces you to two types of data structures: dictionaries and arrays. There are multiple types and classes for both of these data structures and this course discusses them and provides information on how to choose the ideal one.&lt;/p&gt;
&lt;p&gt;In this course you&amp;rsquo;ll learn about:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What are the &lt;strong&gt;advantages&lt;/strong&gt; of using the built-in &lt;code&gt;dict&lt;/code&gt; type &lt;/li&gt;
&lt;li&gt;What are four &lt;strong&gt;other types&lt;/strong&gt; of dictionaries &lt;/li&gt;
&lt;li&gt;How &lt;code&gt;list&lt;/code&gt; and &lt;code&gt;tuple&lt;/code&gt; types are &lt;strong&gt;arrays&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What are typed arrays and how can they &lt;strong&gt;save memory&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How &lt;strong&gt;strings are arrays&lt;/strong&gt; and what that implies&lt;/li&gt;
&lt;li&gt;What are the different arrays for storing &lt;strong&gt;binary data&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What are the &lt;strong&gt;practical uses&lt;/strong&gt; for the different types&lt;/li&gt;
&lt;li&gt;How to select the &lt;strong&gt;ideal data structure&lt;/strong&gt; for your programs&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python &amp; APIs: A Winning Combo for Reading Public Data</title>
      <id>https://realpython.com/python-api/</id>
      <link href="https://realpython.com/python-api/"/>
      <updated>2021-02-22T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn what APIs are and how to consume them using Python. You&#x27;ll also learn some core concepts for working with APIs, such as status codes, HTTP methods, using the requests library, and much more. You&#x27;ll also see a few examples of real-life APIs and how to consume them.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Knowing how to consume an API is one of those magical skills that, once mastered, will crack open a whole new world of possibilities, and consuming APIs using Python is a great way to learn such a skill.&lt;/p&gt;
&lt;p&gt;A lot of apps and systems you use on a daily basis are connected to an API. From very simple and mundane things, like checking the weather in the morning, to more addictive and time-consuming actions, such as scrolling through your Instagram, TikTok, or Twitter feed, APIs play a central role.&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 an &lt;strong&gt;API&lt;/strong&gt; is&lt;/li&gt;
&lt;li&gt;How you can &lt;strong&gt;consume APIs&lt;/strong&gt; with your Python code&lt;/li&gt;
&lt;li&gt;What the most important &lt;strong&gt;API-related concepts&lt;/strong&gt; are &lt;/li&gt;
&lt;li&gt;How to use Python to &lt;strong&gt;read data&lt;/strong&gt; available through public APIs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By the end of this tutorial, you’ll be able to use Python to consume most APIs you come across. If you’re a developer, knowing how to consume APIs with Python will make you much more proficient, especially when it comes to integrating your work with third-party applications.&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; This tutorial is focused on how to &lt;em&gt;consume&lt;/em&gt; APIs using Python, not how to build them. For information on building an API with Python, check out &lt;a href=&quot;https://realpython.com/flask-connexion-rest-api/&quot;&gt;Python REST APIs With Flask, Connexion, and SQLAlchemy&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You can download the source code for the examples you’ll see in this tutorial by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get the Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/consuming-apis-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-consuming-apis-python-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get the source code you’ll use&lt;/a&gt; to learn about consuming APIs with Python in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;getting-to-know-apis&quot;&gt;Getting to Know APIs&lt;a class=&quot;headerlink&quot; href=&quot;#getting-to-know-apis&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;API stands for &lt;strong&gt;application programming interface&lt;/strong&gt;. In essence, an API acts as a communication layer, or as the name says, an interface, that allows different systems to talk to each other without having to understand exactly what each other does.&lt;/p&gt;
&lt;p&gt;APIs can come in many forms or shapes. They can be operating system APIs, used for actions like turning on your camera and audio for joining a Zoom call. Or they can be web APIs, used for web-focused actions such as liking images on your Instagram or fetching the latest tweets.&lt;/p&gt;
&lt;p&gt;No matter the type, all APIs function mostly the same way. You usually make a &lt;strong&gt;request&lt;/strong&gt; for information or data, and the API returns a &lt;strong&gt;response&lt;/strong&gt; with what you requested. For example, every time you open Twitter or scroll down your Instagram feed, you’re basically making a request to the API behind that app and getting a response in return. This is also known as &lt;strong&gt;calling&lt;/strong&gt; an API.&lt;/p&gt;
&lt;p&gt;In this tutorial you’ll focus more on the high-level APIs that communicate across networks, also called &lt;strong&gt;web APIs&lt;/strong&gt;. &lt;/p&gt;
&lt;h3 id=&quot;soap-vs-rest-vs-graphql&quot;&gt;SOAP vs REST vs GraphQL&lt;a class=&quot;headerlink&quot; href=&quot;#soap-vs-rest-vs-graphql&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Even though some of the examples mentioned above are geared toward newer platforms or apps, web APIs have been around for quite a long time. In the late 1990s and early 2000s, two different design models became the norm in exposing data publicly:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;SOAP (Simple Object Access Protocol)&lt;/strong&gt; is typically associated with the enterprise world, has a stricter contract-based usage, and is mostly designed around actions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;REST (Representational State Transfer)&lt;/strong&gt; is typically used for public APIs and is ideal for fetching data from the web. It’s much lighter and closer to the HTTP specification than SOAP.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Nowadays, there’s a new kid in town: &lt;a href=&quot;https://graphql.org/&quot;&gt;GraphQL&lt;/a&gt;. Created by Facebook, GraphQL is a very flexible query language for APIs, where the clients decide exactly what they want to fetch from the server instead of the server deciding what to send.&lt;/p&gt;
&lt;p&gt;If you want to learn more about the differences between these three design models, then here are a few good resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.altexsoft.com/blog/engineering/what-is-soap-formats-protocols-message-structure-and-how-soap-is-different-from-rest/&quot;&gt;What is SOAP?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://restfulapi.net/&quot;&gt;What is REST?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.postman.com/soap-vs-rest/&quot;&gt;API 101: SOAP vs. REST&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://graphql.org/learn/&quot;&gt;Introduction to GraphQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.altexsoft.com/blog/soap-vs-rest-vs-graphql-vs-rpc/&quot;&gt;Comparing API Architectural Styles: SOAP vs REST vs GraphQL vs RPC&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even though GraphQL is on the rise and is being adopted by bigger and bigger companies, including &lt;a href=&quot;https://docs.github.com/en/free-pro-team@latest/graphql&quot;&gt;GitHub&lt;/a&gt; and &lt;a href=&quot;https://shopify.dev/docs/admin-api/graphql/reference&quot;&gt;Shopify&lt;/a&gt;, the truth is that the majority of public APIs are still REST APIs. Therefore, for the purpose of this tutorial, you’ll learn only about REST APIs and how to consume them using Python.&lt;/p&gt;
&lt;h3 id=&quot;requests-and-apis-a-match-made-in-heaven&quot;&gt;&lt;code&gt;requests&lt;/code&gt; and APIs: A Match Made in Heaven&lt;a class=&quot;headerlink&quot; href=&quot;#requests-and-apis-a-match-made-in-heaven&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;When consuming APIs with Python, there’s only one library you need: &lt;a href=&quot;https://realpython.com/python-requests/&quot;&gt;&lt;code&gt;requests&lt;/code&gt;&lt;/a&gt;. With it, you should be able to do most, if not all, of the actions required to consume any public API.&lt;/p&gt;
&lt;p&gt;You can install &lt;code&gt;requests&lt;/code&gt; by running the following command in your console:&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 requests
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To follow the code examples in this tutorial, make sure you’re using Python 3.8.1 and &lt;code&gt;requests&lt;/code&gt; 2.24.0 or higher.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-api/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-api/ »&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 #48: Stochastic Gradient Descent and Deploying Your Python Scripts on the Web</title>
      <id>https://realpython.com/podcasts/rpp/48/</id>
      <link href="https://realpython.com/podcasts/rpp/48/"/>
      <updated>2021-02-19T12:00:00+00:00</updated>
      <summary>Do you know the initial steps to get your Python script hosted on the web? You may have built something with Flask, but how would you stand it up so that you can share it with others? This week on the show, we have the previous guest Martin Breuss back on the show. Martin shares his recent article titled, &quot;Python Web Applications: Deploy Your Script as a Flask App&quot;.  David Amos also returns, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Do you know the initial steps to get your Python script hosted on the web? You may have built something with Flask, but how would you stand it up so that you can share it with others? This week on the show, we have the previous guest Martin Breuss back on the show. Martin shares his recent article titled, &quot;Python Web Applications: Deploy Your Script as a Flask App&quot;.  David Amos also returns, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Functional Programming in Python: When and How to Use It</title>
      <id>https://realpython.com/python-functional-programming/</id>
      <link href="https://realpython.com/python-functional-programming/"/>
      <updated>2021-02-17T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn about functional programming in Python.  You&#x27;ll see what functional programming is, how it&#x27;s supported in Python, and how you can use it in your Python code.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;Functional programming&lt;/strong&gt; is a programming paradigm in which the primary method of computation is evaluation of functions. In this tutorial, you’ll explore functional programming in Python.&lt;/p&gt;
&lt;p&gt;Functional programming typically plays a fairly small role in Python code. But it’s good to be familiar with it. At a minimum, you’ll probably encounter it from time to time when reading code written by others. You may even find situations where it’s advantageous to use Python’s functional programming capabilities in your own code.&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 the &lt;strong&gt;functional programming&lt;/strong&gt; paradigm entails&lt;/li&gt;
&lt;li&gt;What it means to say that &lt;strong&gt;functions&lt;/strong&gt; are &lt;strong&gt;first-class citizens&lt;/strong&gt; in Python&lt;/li&gt;
&lt;li&gt;How to define &lt;strong&gt;anonymous functions&lt;/strong&gt; with the &lt;strong&gt;&lt;code&gt;lambda&lt;/code&gt;&lt;/strong&gt; keyword&lt;/li&gt;
&lt;li&gt;How to implement functional code using &lt;strong&gt;&lt;code&gt;map()&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;filter()&lt;/code&gt;&lt;/strong&gt;, and &lt;strong&gt;&lt;code&gt;reduce()&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-mastery-course/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-mastery-course&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;5 Thoughts On Python Mastery&lt;/a&gt;, a free course for Python developers that shows you the roadmap and the mindset you’ll need to take your Python skills to the next level.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-is-functional-programming&quot;&gt;What Is Functional Programming?&lt;a class=&quot;headerlink&quot; href=&quot;#what-is-functional-programming&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A &lt;strong&gt;pure function&lt;/strong&gt; is a function whose output value follows solely from its input values, without any observable &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/#side-effects&quot;&gt;side effects&lt;/a&gt;. In &lt;strong&gt;functional programming&lt;/strong&gt;, a program consists entirely of evaluation of pure functions. Computation proceeds by nested or &lt;a href=&quot;https://en.wikipedia.org/wiki/Function_composition_(computer_science)&quot;&gt;composed function calls&lt;/a&gt;, without changes to state or mutable data.&lt;/p&gt;
&lt;p&gt;The functional paradigm is popular because it offers several advantages over other programming paradigms. Functional code is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;High level:&lt;/strong&gt; You’re describing the result you want rather than explicitly specifying the steps required to get there. Single statements tend to be concise but pack a lot of punch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transparent:&lt;/strong&gt; The behavior of a pure function depends only on its inputs and outputs, without intermediary values. That eliminates the possibility of side effects, which facilitates &lt;a href=&quot;https://realpython.com/python-debugging-pdb/&quot;&gt;debugging&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parallelizable:&lt;/strong&gt; Routines that don’t cause side effects can more easily &lt;a href=&quot;https://realpython.com/learning-paths/python-concurrency-parallel-programming/&quot;&gt;run in parallel&lt;/a&gt; with one another.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Many programming languages support some degree of functional programming. In some languages, virtually all code follows the functional paradigm. &lt;a href=&quot;https://www.haskell.org&quot;&gt;Haskell&lt;/a&gt; is one such example. Python, by contrast, does support functional programming but contains features of other programming models as well.&lt;/p&gt;
&lt;p&gt;While it’s true that an in-depth &lt;a href=&quot;https://en.wikipedia.org/wiki/Functional_programming&quot;&gt;description of functional programming&lt;/a&gt; is somewhat complex, the goal here isn’t to present a rigorous definition but to show you what you can do by way of functional programming in Python.&lt;/p&gt;
&lt;h2 id=&quot;how-well-does-python-support-functional-programming&quot;&gt;How Well Does Python Support Functional Programming?&lt;a class=&quot;headerlink&quot; href=&quot;#how-well-does-python-support-functional-programming&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To support functional programming, it’s useful if a &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;function&lt;/a&gt; in a given programming language has two abilities:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;To take another function as an argument&lt;/li&gt;
&lt;li&gt;To return another function to its caller&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Python plays nicely in both these respects. As you’ve learned previously in this series, &lt;a href=&quot;https://realpython.com/python-variables/#object-references&quot;&gt;everything in a Python program is an object&lt;/a&gt;. All objects in Python have more or less equal stature, and functions are no exception.&lt;/p&gt;
&lt;p&gt;In Python, functions are &lt;strong&gt;first-class citizens&lt;/strong&gt;. That means functions have the same characteristics as values like &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;strings&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-numbers/&quot;&gt;numbers&lt;/a&gt;. Anything you would expect to be able to do with a string or number you can do with a function as well.&lt;/p&gt;
&lt;p&gt;For example, you can assign a function to a variable. You can then use that variable the same as you would use the function itself:&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;linenos&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 2&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;I am function func()!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 3&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 4&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 5&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 6&lt;/span&gt;&lt;span class=&quot;go&quot;&gt;I am function func()!&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 7&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 8&lt;/span&gt;&lt;span class=&quot;hll&quot;&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;another_name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;func&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;linenos&quot;&gt; 9&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;another_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;go&quot;&gt;I am function func()!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The assignment &lt;code&gt;another_name = func&lt;/code&gt; on line 8 creates a new reference to &lt;code&gt;func()&lt;/code&gt; named &lt;code&gt;another_name&lt;/code&gt;. You can then call the function by either name, &lt;code&gt;func&lt;/code&gt; or &lt;code&gt;another_name&lt;/code&gt;, as shown on lines 5 and 9.&lt;/p&gt;
&lt;p&gt;You can display a function to the console with &lt;a href=&quot;https://realpython.com/python-print/&quot;&gt;&lt;code&gt;print()&lt;/code&gt;&lt;/a&gt;, include it as an element in a composite data object like a &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;list&lt;/a&gt;, or even use it as a &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionary&lt;/a&gt; key:&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;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;func&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;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;I am function func()!&quot;&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;hll&quot;&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;cat&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;go&quot;&gt;cat &amp;lt;function func at 0x7f81b4d29bf8&amp;gt; 42&lt;/span&gt;

&lt;span class=&quot;hll&quot;&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;objects&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;cat&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&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;objects&lt;/span&gt;&lt;span class=&quot;p&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;go&quot;&gt;&amp;lt;function func at 0x7f81b4d29bf8&amp;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;objects&lt;/span&gt;&lt;span class=&quot;p&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;go&quot;&gt;I am function func()!&lt;/span&gt;

&lt;span class=&quot;hll&quot;&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&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;cat&quot;&lt;/span&gt;&lt;span class=&quot;p&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;n&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&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;mi&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;p&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&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this example, &lt;code&gt;func()&lt;/code&gt; appears in all the same contexts as the values &lt;code&gt;&quot;cat&quot;&lt;/code&gt; and &lt;code&gt;42&lt;/code&gt;, and the interpreter handles it just fine.&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; What you can or can’t do with any object in Python depends to some extent on context. There are some operations, for example, that work for certain object types but not for others. &lt;/p&gt;
&lt;p&gt;You can add two integer objects or concatenate two string objects with the plus operator (&lt;code&gt;+&lt;/code&gt;). But the plus operator isn’t defined for function objects.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;For present purposes, what matters is that functions in Python satisfy the two criteria beneficial for functional programming listed above. You can pass a function to another function as an argument:&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;linenos&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 2&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;I am function inner()!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 3&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 4&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 5&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;outer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 6&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 7&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 8&lt;/span&gt;
&lt;span class=&quot;linenos&quot;&gt; 9&lt;/span&gt;&lt;span class=&quot;hll&quot;&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;linenos&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;go&quot;&gt;I am function inner()!&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-functional-programming/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-functional-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>Creating PyQt Layouts for GUI Applications</title>
      <id>https://realpython.com/courses/creating-pyqt-layouts-gui-applications/</id>
      <link href="https://realpython.com/courses/creating-pyqt-layouts-gui-applications/"/>
      <updated>2021-02-16T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you’ll learn how to use PyQt layouts to arrange and manage the graphical components on your GUI applications. With the help of PyQt&#x27;s layout managers, you&#x27;ll be able to create polished and professional GUIs with minimal effort.</summary>
      <content type="html">
        &lt;p&gt;PyQt&amp;rsquo;s &lt;a href=&quot;https://doc.qt.io/qt-5/layout.html&quot;&gt;layout managers&lt;/a&gt; provide a user-friendly and productive way of arranging graphical components, or &lt;strong&gt;widgets&lt;/strong&gt;, on a GUI. Laying out widgets properly will make your &lt;a href=&quot;https://realpython.com/learning-paths/python-gui-programming/&quot;&gt;GUI applications&lt;/a&gt; look polished and professional. Learning to do so efficiently and effectively is a fundamental skill for you to get up and running with GUI application development using Python and PyQt.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What the benefits are of using PyQt&amp;rsquo;s &lt;strong&gt;layout managers&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;How to programmatically &lt;strong&gt;lay out widgets&lt;/strong&gt; on a GUI using PyQt&amp;rsquo;s layout managers &lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;select the right layout manager&lt;/strong&gt; for your GUI application&lt;/li&gt;
&lt;li&gt;How to lay out widgets in &lt;strong&gt;main window&amp;ndash;based&lt;/strong&gt; and &lt;strong&gt;dialog-based&lt;/strong&gt; applications&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a better understanding of how to use layout managers, some previous knowledge of how to create &lt;a href=&quot;https://realpython.com/python-pyqt-gui-calculator/&quot;&gt;PyQt GUI applications&lt;/a&gt; and how to work with &lt;a href=&quot;https://doc.qt.io/qt-5/qwidget.html&quot;&gt;PyQt widgets&lt;/a&gt; would be helpful.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Pandas Sort: Your Guide to Sorting Data in Python</title>
      <id>https://realpython.com/pandas-sort-python/</id>
      <link href="https://realpython.com/pandas-sort-python/"/>
      <updated>2021-02-15T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to sort data in a pandas DataFrame using the pandas sort functions sort_values() and sort_index(). You&#x27;ll learn how to sort by one or more columns and by index in ascending or descending order.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Learning pandas &lt;strong&gt;sort methods&lt;/strong&gt; is a great way to start with or practice doing basic &lt;a href=&quot;https://realpython.com/pandas-python-explore-dataset/&quot;&gt;data analysis using Python&lt;/a&gt;. Most commonly, data analysis is done with &lt;a href=&quot;https://realpython.com/openpyxl-excel-spreadsheets-python/&quot;&gt;spreadsheets&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-sql-libraries/&quot;&gt;SQL&lt;/a&gt;, or &lt;a href=&quot;https://realpython.com/learning-paths/pandas-data-science/&quot;&gt;pandas&lt;/a&gt;. One of the great things about using pandas is that it can handle a large amount of data and offers highly performant data manipulation capabilities.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll learn how to use &lt;code&gt;.sort_values()&lt;/code&gt; and &lt;code&gt;.sort_index()&lt;/code&gt;, which will enable you to sort data efficiently in a DataFrame.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll know how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sort a &lt;strong&gt;pandas DataFrame&lt;/strong&gt; by the values of one or more columns&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;ascending&lt;/code&gt; parameter to change the &lt;strong&gt;sort order&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Sort a DataFrame by its &lt;code&gt;index&lt;/code&gt; using &lt;strong&gt;&lt;code&gt;.sort_index()&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Organize &lt;strong&gt;missing data&lt;/strong&gt; while sorting values&lt;/li&gt;
&lt;li&gt;Sort a DataFrame &lt;strong&gt;in place&lt;/strong&gt; using &lt;code&gt;inplace&lt;/code&gt; set to &lt;code&gt;True&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To follow along with this tutorial, you’ll need a basic understanding of &lt;a href=&quot;https://www.realpython.com/pandas-dataframe/&quot;&gt;pandas DataFrames&lt;/a&gt; and some familiarity with &lt;a href=&quot;https://realpython.com/python-csv/#reading-csv-files-with-pandas&quot;&gt;reading in data from files&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 Bonus:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-cheat-sheet-shortened&quot; data-focus=&quot;false&quot;&gt;Click here to get a Python Cheat Sheet&lt;/a&gt; and learn the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;getting-started-with-pandas-sort-methods&quot;&gt;Getting Started With Pandas Sort Methods&lt;a class=&quot;headerlink&quot; href=&quot;#getting-started-with-pandas-sort-methods&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;As a quick reminder, a &lt;strong&gt;DataFrame&lt;/strong&gt; is a data structure with labeled axes for both rows and columns. You can sort a DataFrame by row or column value as well as by row or column index. &lt;/p&gt;
&lt;p&gt;Both rows and columns have &lt;strong&gt;indices&lt;/strong&gt;, which are numerical representations of where the data is in your DataFrame. You can retrieve data from specific rows or columns using the DataFrame’s index locations. By default, index numbers start from zero. You can also manually assign your own index.&lt;/p&gt;
&lt;h3 id=&quot;preparing-the-dataset&quot;&gt;Preparing the Dataset&lt;a class=&quot;headerlink&quot; href=&quot;#preparing-the-dataset&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In this tutorial, you’ll be working with fuel economy data compiled by the US Environmental Protection Agency (EPA) on vehicles made between 1984 and 2021. The &lt;a href=&quot;https://www.fueleconomy.gov/feg/download.shtml&quot;&gt;EPA fuel economy dataset&lt;/a&gt; is great because it has many different types of information that you can sort on, from textual to numeric data types. The dataset contains eighty-three columns in total. &lt;/p&gt;
&lt;p&gt;To follow along, you’ll need to have the &lt;a href=&quot;https://pandas.pydata.org/&quot;&gt;pandas&lt;/a&gt; Python library installed. The code in this tutorial was executed using pandas 1.2.0 and &lt;a href=&quot;https://www.python.org/downloads/release/python-391/&quot;&gt;Python 3.9.1&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The whole fuel economy dataset is around 18 MB. Reading the entire dataset into memory could take a minute or two. Limiting the number of rows and columns will help performance, but it will still take a few seconds before the data is downloaded.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;For analysis purposes, you’ll be looking at MPG (miles per gallon) data on vehicles by make, model, year, and other vehicle attributes. You can specify which columns to read into your DataFrame. For this tutorial, you’ll need only a subset of the &lt;a href=&quot;https://www.fueleconomy.gov/feg/ws/index.shtml#vehicle&quot;&gt;available columns&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here are the commands to read the relevant columns of the fuel economy dataset into a DataFrame and to display the first five rows:&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;pandas&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pd&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;column_subset&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;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;s2&quot;&gt;&quot;id&quot;&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;s2&quot;&gt;&quot;make&quot;&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;s2&quot;&gt;&quot;model&quot;&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;s2&quot;&gt;&quot;year&quot;&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;s2&quot;&gt;&quot;cylinders&quot;&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;s2&quot;&gt;&quot;fuelType&quot;&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;s2&quot;&gt;&quot;trany&quot;&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;s2&quot;&gt;&quot;mpgData&quot;&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;s2&quot;&gt;&quot;city08&quot;&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;s2&quot;&gt;&quot;highway08&quot;&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;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;df&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read_csv&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;s2&quot;&gt;&quot;https://www.fueleconomy.gov/feg/epadata/vehicles.csv&quot;&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;n&quot;&gt;usecols&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;column_subset&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;n&quot;&gt;nrows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&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;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;df&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;   city08  cylinders fuelType  ...  mpgData            trany  year&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;0      19          4  Regular  ...        Y     Manual 5-spd  1985&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1       9         12  Regular  ...        N     Manual 5-spd  1985&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2      23          4  Regular  ...        Y     Manual 5-spd  1985&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;3      10          8  Regular  ...        N  Automatic 3-spd  1985&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;4      17          4  Premium  ...        N     Manual 5-spd  1993&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[5 rows x 10 columns]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;By calling &lt;code&gt;.read_csv()&lt;/code&gt; with the dataset URL, you’re able to load the data into a DataFrame. Narrowing down the columns results in faster load times and lower memory use. To further limit memory consumption and to get a quick feel for the data, you can specify how many rows to load using &lt;code&gt;nrows&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;getting-familiar-with-sort_values&quot;&gt;Getting Familiar With &lt;code&gt;.sort_values()&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#getting-familiar-with-sort_values&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You use &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sort_values.html&quot;&gt;&lt;code&gt;.sort_values()&lt;/code&gt;&lt;/a&gt; to sort values in a DataFrame along either axis (columns or rows). Typically, you want to sort the rows in a DataFrame by the values of one or more columns:&lt;/p&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/dataframe-values-sort.62a6327755df.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/dataframe-values-sort.62a6327755df.png&quot; width=&quot;1004&quot; height=&quot;547&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/dataframe-values-sort.62a6327755df.png&amp;amp;w=251&amp;amp;sig=4faa9dcb7aa400dc0c409721fab10b998f520a60 251w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/dataframe-values-sort.62a6327755df.png&amp;amp;w=502&amp;amp;sig=36ad798b1404a2b56402ed4fe27705a743dfb910 502w, https://files.realpython.com/media/dataframe-values-sort.62a6327755df.png 1004w&quot; sizes=&quot;75vw&quot; alt=&quot;Pandas DataFrame Sorted by Column Values&quot; data-asset=&quot;3430&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;The figure above shows the results of using &lt;code&gt;.sort_values()&lt;/code&gt; to sort the DataFrame’s rows based on the values in the &lt;code&gt;highway08&lt;/code&gt; column. This is similar to how you would sort data in a spreadsheet using a column.&lt;/p&gt;
&lt;h3 id=&quot;getting-familiar-with-sort_index&quot;&gt;Getting Familiar With &lt;code&gt;.sort_index()&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#getting-familiar-with-sort_index&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You use &lt;code&gt;.sort_index()&lt;/code&gt; to sort a DataFrame by its row index or column labels. The difference from using &lt;code&gt;.sort_values()&lt;/code&gt; is that you’re sorting the DataFrame based on its row index or column names, not by the values in these rows or columns:&lt;/p&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/dataframe-row-index.d6aa0bd658aa.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/dataframe-row-index.d6aa0bd658aa.png&quot; width=&quot;1020&quot; height=&quot;560&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/dataframe-row-index.d6aa0bd658aa.png&amp;amp;w=255&amp;amp;sig=b61058ae50297e41ef020b0648539179badb6242 255w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/dataframe-row-index.d6aa0bd658aa.png&amp;amp;w=510&amp;amp;sig=a4f2a1bdcab30f5d3b95ff12b63d3f9955083569 510w, https://files.realpython.com/media/dataframe-row-index.d6aa0bd658aa.png 1020w&quot; sizes=&quot;75vw&quot; alt=&quot;Pandas DataFrame Sorted by Row Index&quot; data-asset=&quot;3431&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;The row index of the DataFrame is outlined in blue in the figure above. An index isn’t considered a column, and you typically have only a single row index. The row index can be thought of as the row numbers, which start from zero.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/pandas-sort-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/pandas-sort-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 #47: Unraveling Python&#x27;s Syntax to Its Core With Brett Cannon</title>
      <id>https://realpython.com/podcasts/rpp/47/</id>
      <link href="https://realpython.com/podcasts/rpp/47/"/>
      <updated>2021-02-12T12:00:00+00:00</updated>
      <summary>Do you feel like you understand how Python works under the hood? What is syntactic sugar, and how much of it should be in Python? This week on the show, we have Brett Cannon. Brett is a Python core developer and he&#x27;s been working on a series of articles where he is unraveling the syntax of Python. His series is a fantastic resource for those wanting to learn how Python is structured and works at its core.</summary>
      <content type="html">
        &lt;p&gt;Do you feel like you understand how Python works under the hood? What is syntactic sugar, and how much of it should be in Python? This week on the show, we have Brett Cannon. Brett is a Python core developer and he&#x27;s been working on a series of articles where he is unraveling the syntax of Python. His series is a fantastic resource for those wanting to learn how Python is structured and works at its core.&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 Microservices With gRPC</title>
      <id>https://realpython.com/python-microservices-grpc/</id>
      <link href="https://realpython.com/python-microservices-grpc/"/>
      <updated>2021-02-10T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to build a robust and developer-friendly Python microservices infrastructure. You&#x27;ll learn what microservices are and how you can implement them using gRPC and Kubernetes. You&#x27;ll also explore advanced topics such as interceptors and integration testing.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;Microservices&lt;/strong&gt; are a way to organize complex software systems. Instead of putting all your code into one app, you break your app into microservices that are deployed independently and communicate with each other. This tutorial teaches you how to get up and running with Python microservices using gRPC, one of the most popular frameworks.&lt;/p&gt;
&lt;p&gt;Implementing a microservices framework well is important. When you’re building a framework to support critical applications, you must ensure it’s robust and developer-friendly. In this tutorial, you’ll learn how to do just that. This knowledge will make you more valuable to growing companies. &lt;/p&gt;
&lt;p&gt;In order to benefit most from this tutorial, you should understand the &lt;a href=&quot;https://realpython.com/tutorials/basics/&quot;&gt;basics of Python&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/flask-by-example-part-1-project-setup/&quot;&gt;web apps&lt;/a&gt;. If you’d like a refresher on those, read through the links provided first.&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;Implement &lt;strong&gt;microservices&lt;/strong&gt; in Python that communicate with one another over gRPC&lt;/li&gt;
&lt;li&gt;Implement &lt;strong&gt;middleware&lt;/strong&gt; to monitor microservices&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unit test&lt;/strong&gt; and &lt;strong&gt;integration test&lt;/strong&gt; your microservices and middleware&lt;/li&gt;
&lt;li&gt;Deploy microservices to a Python production environment with &lt;strong&gt;Kubernetes&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can download all the source code used in this tutorial by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get the Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-microservices-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-microservices-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get the source code you’ll use&lt;/a&gt; to learn about creating Python microservices with gRPC in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;why-microservices&quot;&gt;Why Microservices?&lt;a class=&quot;headerlink&quot; href=&quot;#why-microservices&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Imagine you work at Online Books For You, a popular e-commerce site that sells books online. The company has several hundred developers. Each developer is writing code for some product or back-end feature, such as managing the user’s cart, generating recommendations, handling payment transactions, or dealing with warehouse inventory.&lt;/p&gt;
&lt;p&gt;Now ask yourself, would you want all that code in one giant application? How hard would that be to understand? How long would it take to test? How would you keep the code and database schemas sane? It definitely would be hard, especially as the business tries to move quickly.&lt;/p&gt;
&lt;p&gt;Wouldn’t you rather have code corresponding to modular product features be, well, modular? A cart microservice to manage carts. An inventory microservice to manage inventory.&lt;/p&gt;
&lt;p&gt;In the sections below, you’ll dig a bit deeper into some reasons to separate Python code into microservices.&lt;/p&gt;
&lt;h3 id=&quot;modularity&quot;&gt;Modularity&lt;a class=&quot;headerlink&quot; href=&quot;#modularity&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Code changes often take the path of least resistance. Your beloved Online Books For You CEO wants to add a new buy-two-books-get-one-free feature. You’re part of the team that’s been asked to launch it as quickly as possible. Take a look at what happens when all your code is in a single application.&lt;/p&gt;
&lt;p&gt;Being the smartest engineer on your team, you mention that you can add some code to the cart logic to check if there are more than two books in the cart. If so, you can simply subtract the cost of the cheapest book from the cart total. No sweat—you make a pull request. &lt;/p&gt;
&lt;p&gt;Then your product manager says you need to track this campaign’s impact on books sales. This is pretty straightforward, too. Since the logic that implements the buy-two-get-one feature is in the cart code, you’ll add a line in the checkout flow that updates a new column on the transactions database to indicate the sale was part of the promotion: &lt;code&gt;buy_two_get_one_free_promo = true&lt;/code&gt;. Done. &lt;/p&gt;
&lt;p&gt;Next, your product manager reminds you that the deal is valid for only one use per customer. You need to add some logic to check whether any previous transactions had that &lt;code&gt;buy_two_get_one_free_promo&lt;/code&gt; flag set. Oh, and you need to hide the promotion banner on the home page, so you add that check, too. Oh, and you need to send emails to people who haven’t used the promo. Add that, too.&lt;/p&gt;
&lt;p&gt;Several years later, the transactions database has grown too large and needs to be replaced with a new shared database. All those references need to be changed. Unfortunately, the database is referenced all over the codebase at this point. You consider that it was actually a little &lt;em&gt;too&lt;/em&gt; easy to add all those references.&lt;/p&gt;
&lt;p&gt;That’s why having all your code in a single application can be dangerous in the long run. Sometimes it’s good to have boundaries. &lt;/p&gt;
&lt;p&gt;The transactions database should be accessible only to a transactions microservice. Then, if you need to scale it, it’s not so bad. Other parts of the code can interact with transactions through an abstracted API that hides the implementation details. You &lt;em&gt;could&lt;/em&gt; do this in a single application—it’s just less likely that you would. Code changes often take the path of least resistance.&lt;/p&gt;
&lt;h3 id=&quot;flexibility&quot;&gt;Flexibility&lt;a class=&quot;headerlink&quot; href=&quot;#flexibility&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Splitting your Python code into microservices gives you more flexibility. For one thing, you can write your microservices in different languages. Oftentimes, a company’s first web app will be written in &lt;a href=&quot;https://www.ruby-lang.org/en/about/&quot;&gt;Ruby&lt;/a&gt; or &lt;a href=&quot;https://www.php.net/manual/en/intro-whatis.php&quot;&gt;PHP&lt;/a&gt;. That doesn’t mean everything else has to be, too!&lt;/p&gt;
&lt;p&gt;You can also scale each microservice independently. In this tutorial, you’ll be using a web app and a Recommendations microservice as a running example. &lt;/p&gt;
&lt;p&gt;Your web app will likely be &lt;a href=&quot;https://en.wikipedia.org/wiki/I/O_bound&quot;&gt;I/O bound&lt;/a&gt;, fetching data from a database and maybe loading templates or other files from disk. A Recommendations microservice may be doing a lot of number crunching, making it &lt;a href=&quot;https://en.wikipedia.org/wiki/CPU-bound&quot;&gt;CPU bound&lt;/a&gt;. It makes sense to run these two Python microservices on different hardware.&lt;/p&gt;
&lt;h3 id=&quot;robustness&quot;&gt;Robustness&lt;a class=&quot;headerlink&quot; href=&quot;#robustness&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-microservices-grpc/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-microservices-grpc/ »&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 Modulo: Using the % Operator</title>
      <id>https://realpython.com/courses/python-modulo-operator/</id>
      <link href="https://realpython.com/courses/python-modulo-operator/"/>
      <updated>2021-02-09T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn about the Python modulo operator (%). You&#x27;ll look at the mathematical concepts behind the modulo operation and how the modulo operator is used with Python&#x27;s numeric types. You&#x27;ll also see ways to use the modulo operator in your own code.</summary>
      <content type="html">
        &lt;p&gt;Python supports a wide range of &lt;a href=&quot;https://realpython.com/python-operators-expressions/#arithmetic-operators&quot;&gt;arithmetic operators&lt;/a&gt; that you can use when working with &lt;a href=&quot;https://realpython.com/python-numbers/&quot;&gt;numbers&lt;/a&gt; in your code. One of these operators is the &lt;strong&gt;modulo operator&lt;/strong&gt; (&lt;code&gt;%&lt;/code&gt;), which returns the remainder of dividing two numbers. Modular operations are useful to check if a number is even or odd, simplifying cycling through data, and doing non-decimal based units conversion.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How &lt;strong&gt;modulo&lt;/strong&gt; works in mathematics&lt;/li&gt;
&lt;li&gt;How to use the Python modulo operator with different &lt;strong&gt;numeric types&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How Python calculates the results of a &lt;strong&gt;modulo operation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to override &lt;strong&gt;&lt;code&gt;.__mod__()&lt;/code&gt;&lt;/strong&gt; in your classes to use them with the modulo operator&lt;/li&gt;
&lt;li&gt;How to use the Python modulo operator to solve &lt;strong&gt;real-world problems&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The code in this course was tested with Python 3.9.0, &lt;code&gt;%&lt;/code&gt; has not change much and older versions should be compatible.&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 Inner Functions: What Are They Good For?</title>
      <id>https://realpython.com/inner-functions-what-are-they-good-for/</id>
      <link href="https://realpython.com/inner-functions-what-are-they-good-for/"/>
      <updated>2021-02-08T17:39:01+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn what inner functions are in Python, how to define them, and what their main use cases are.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;strong&gt;Inner functions&lt;/strong&gt;, also known as &lt;strong&gt;nested functions&lt;/strong&gt;, are &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;functions&lt;/a&gt; that you define inside other functions. In Python, this kind of function has direct access to variables and names defined in the enclosing function. Inner functions have many uses, most notably as closure factories and decorator functions.&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;Provide &lt;strong&gt;encapsulation&lt;/strong&gt; and hide your functions from external access&lt;/li&gt;
&lt;li&gt;Write &lt;strong&gt;helper functions&lt;/strong&gt; to facilitate code reuse&lt;/li&gt;
&lt;li&gt;Create &lt;strong&gt;closure factory functions&lt;/strong&gt; that retain state between calls&lt;/li&gt;
&lt;li&gt;Code &lt;strong&gt;decorator functions&lt;/strong&gt; to add behavior to existing functions&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-cheat-sheet-shortened&quot; data-focus=&quot;false&quot;&gt;Click here to get a Python Cheat Sheet&lt;/a&gt; and learn the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;creating-python-inner-functions&quot;&gt;Creating Python Inner Functions&lt;a class=&quot;headerlink&quot; href=&quot;#creating-python-inner-functions&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A function defined inside another function is known as an &lt;strong&gt;inner function&lt;/strong&gt; or a &lt;strong&gt;nested function&lt;/strong&gt;. In Python, this kind of function can access &lt;a href=&quot;https://realpython.com/python-scope-legb-rule/#names-and-scopes-in-python&quot;&gt;names&lt;/a&gt; in the enclosing function. Here’s an example of how to create an inner function in Python:&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;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;outer_func&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;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;inner_func&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;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&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;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;inner_func&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;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outer_func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Hello, World!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this code, you define &lt;code&gt;inner_func()&lt;/code&gt; inside &lt;code&gt;outer_func()&lt;/code&gt; to &lt;a href=&quot;https://realpython.com/python-print/&quot;&gt;print&lt;/a&gt; the &lt;code&gt;Hello, World!&lt;/code&gt; message to the screen. To do that, you call &lt;code&gt;inner_func()&lt;/code&gt; on the last line of &lt;code&gt;outer_func()&lt;/code&gt;. This is the quickest way to write an inner function in Python. However, inner functions provide a lot of interesting possibilities beyond what you see in this example.&lt;/p&gt;
&lt;p&gt;The core feature of inner functions is their ability to access variables and objects from their enclosing function even after this function has returned. The enclosing function provides a &lt;a href=&quot;https://realpython.com/python-namespaces-scope/&quot;&gt;namespace&lt;/a&gt; that is accessible to the inner function:&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;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;outer_func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;who&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;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;inner_func&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;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Hello, &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;who&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;inner_func&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;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;outer_func&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;World!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Hello, World!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now you can pass a &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;string&lt;/a&gt; as an argument to &lt;code&gt;outer_func()&lt;/code&gt;, and &lt;code&gt;inner_func()&lt;/code&gt; will access that argument through the name &lt;code&gt;who&lt;/code&gt;. This name, however, is defined in the &lt;a href=&quot;https://realpython.com/python-scope-legb-rule/#functions-the-local-scope&quot;&gt;local scope&lt;/a&gt; of &lt;code&gt;outer_func()&lt;/code&gt;. The names that you define in the local scope of an outer function are known as &lt;strong&gt;nonlocal names&lt;/strong&gt;. They are nonlocal from the &lt;code&gt;inner_func()&lt;/code&gt; point of view.&lt;/p&gt;
&lt;p&gt;Here’s an example of how to create and use a more elaborate inner function:&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;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;factorial&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&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;c1&quot;&gt;# Validate input&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;isinstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;        &lt;span class=&quot;k&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;TypeError&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Sorry. &#x27;number&#x27; must be an integer.&quot;&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;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&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;k&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;ne&quot;&gt;ValueError&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Sorry. &#x27;number&#x27; must be zero or positive.&quot;&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;c1&quot;&gt;# Calculate the factorial of number&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;inner_factorial&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&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;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&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;gp&quot;&gt;... &lt;/span&gt;            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inner_factorial&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&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;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inner_factorial&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&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;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;factorial&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;24&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In &lt;code&gt;factorial()&lt;/code&gt;, you first validate the input data to make sure that your user is providing an integer that is equal to or greater than zero. Then you define a recursive inner function called &lt;code&gt;inner_factorial()&lt;/code&gt; that performs the factorial calculation and &lt;a href=&quot;https://realpython.com/python-return-statement/&quot;&gt;returns&lt;/a&gt; the result. The final step is to call &lt;code&gt;inner_factorial()&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; For a more detailed discussion on recursion and recursive functions, check out &lt;a href=&quot;https://realpython.com/python-thinking-recursively/&quot;&gt;Thinking Recursively in Python&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The main advantage of using this pattern is that, by performing all the argument checking in the outer function, you can safely skip error checking in the inner function and focus on the computation at hand.&lt;/p&gt;
&lt;h2 id=&quot;using-inner-functions-the-basics&quot;&gt;Using Inner Functions: The Basics&lt;a class=&quot;headerlink&quot; href=&quot;#using-inner-functions-the-basics&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The use cases of Python inner functions are varied. You can use them to provide &lt;a href=&quot;https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)&quot;&gt;encapsulation&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Information_hiding&quot;&gt;hide&lt;/a&gt; your functions from external access, you can write helper inner functions, and you can also create &lt;a href=&quot;https://en.wikipedia.org/wiki/Closure_(computer_programming)&quot;&gt;closures&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Decorator_pattern&quot;&gt;decorators&lt;/a&gt;. In this section, you’ll learn about the former two use cases of inner functions, and in later sections, you’ll learn how to create &lt;a href=&quot;#retaining-state-with-inner-functions-closures&quot;&gt;closure factory functions&lt;/a&gt; and &lt;a href=&quot;#adding-behavior-with-inner-functions-decorators&quot;&gt;decorators&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;providing-encapsulation&quot;&gt;Providing Encapsulation&lt;a class=&quot;headerlink&quot; href=&quot;#providing-encapsulation&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A common use case of inner functions arises when you need to protect, or hide, a given function from everything happening outside of it so that the function is totally hidden from the global &lt;a href=&quot;https://realpython.com/python-namespaces-scope/&quot;&gt;scope&lt;/a&gt;. This kind of behavior is commonly known as &lt;strong&gt;encapsulation&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Here’s an example that highlights that concept:&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;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;increment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number&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;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;inner_increment&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;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;number&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;gp&quot;&gt;... &lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inner_increment&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;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;increment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;11&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Call inner_increment()&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;inner_increment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;gt&quot;&gt;Traceback (most recent call last):&lt;/span&gt;
  File &lt;span class=&quot;nb&quot;&gt;&quot;&amp;lt;input&amp;gt;&quot;&lt;/span&gt;, line &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;, in &lt;span class=&quot;n&quot;&gt;&amp;lt;module&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;inner_increment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;gr&quot;&gt;NameError&lt;/span&gt;: &lt;span class=&quot;n&quot;&gt;name &#x27;inner_increment&#x27; is not defined&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this example, you can’t access &lt;code&gt;inner_increment()&lt;/code&gt; directly. If you try to do it, then you get a &lt;code&gt;NameError&lt;/code&gt;. That’s because &lt;code&gt;increment()&lt;/code&gt; totally hides &lt;code&gt;inner_increment()&lt;/code&gt;, preventing you from accessing it from the global scope.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/inner-functions-what-are-they-good-for/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/inner-functions-what-are-they-good-for/ »&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 #46: C for Python Developers and Data Visualization With Dash</title>
      <id>https://realpython.com/podcasts/rpp/46/</id>
      <link href="https://realpython.com/podcasts/rpp/46/"/>
      <updated>2021-02-05T12:00:00+00:00</updated>
      <summary>Are you interested in building interactive dashboards with Python? How about a project that takes a flat data file all the way to a web-hosted interactive  dashboard? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Are you interested in building interactive dashboards with Python? How about a project that takes a flat data file all the way to a web-hosted interactive  dashboard? This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Qt Designer and Python: Build Your GUI Applications Faster</title>
      <id>https://realpython.com/qt-designer-python/</id>
      <link href="https://realpython.com/qt-designer-python/"/>
      <updated>2021-02-03T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn how to use Qt Designer to create GUIs from your windows and dialogs and use them in your Python applications.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;To create a GUI for your windows and dialogs in PyQt, you can take two main paths: you can use &lt;a href=&quot;https://doc.qt.io/qt-5/qtdesigner-manual.html&quot;&gt;Qt Designer&lt;/a&gt;, or you can &lt;strong&gt;hand code&lt;/strong&gt; the GUI in plain Python code. The first path can dramatically improve your productivity, whereas the second path puts you in full control of your application’s code.&lt;/p&gt;
&lt;p&gt;GUI applications often consist of a &lt;strong&gt;main window&lt;/strong&gt; and several &lt;strong&gt;dialogs&lt;/strong&gt;. If you’re looking to create these graphical components in an efficient and user-friendly way, then Qt Designer is the tool for you. In this tutorial, you’ll learn how to use Qt Designer to create your GUIs productively.&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;Qt Designer&lt;/strong&gt; is and how to install it on your system&lt;/li&gt;
&lt;li&gt;When to use &lt;strong&gt;Qt Designer vs hand coding&lt;/strong&gt; for building your GUIs&lt;/li&gt;
&lt;li&gt;How to build and lay out the GUI of an application’s &lt;strong&gt;main window&lt;/strong&gt; using Qt Designer&lt;/li&gt;
&lt;li&gt;How to create and lay out the GUI of your &lt;strong&gt;dialogs&lt;/strong&gt; with Qt Designer&lt;/li&gt;
&lt;li&gt;How to use Qt Designer’s &lt;strong&gt;&lt;code&gt;.ui&lt;/code&gt; files&lt;/strong&gt; in your GUI applications&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a better understanding of the topics in this tutorial, you can check out the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-pyqt-gui-calculator/&quot;&gt;Python and PyQt: Building a GUI Desktop Calculator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-menus-toolbars/&quot;&gt;Python and PyQt: Creating Menus, Toolbars, and Status Bars&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-pyqt-layout/&quot;&gt;PyQt Layouts: Create Professional-Looking GUI Applications&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll put all this knowledge together by using the GUIs that you’ll build with Qt Designer in a sample text editor application. You can get the code and all the required resources to build this application by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get the Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/qt-designer-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-qt-designer-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get the source code you’ll use&lt;/a&gt; to learn about creating Python GUI applications with Qt Designer in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;getting-started-with-qt-designer&quot;&gt;Getting Started With Qt Designer&lt;a class=&quot;headerlink&quot; href=&quot;#getting-started-with-qt-designer&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Qt Designer&lt;/strong&gt; is a &lt;a href=&quot;https://www.qt.io/&quot;&gt;Qt&lt;/a&gt; tool that provides you with a &lt;a href=&quot;https://en.wikipedia.org/wiki/WYSIWYG&quot;&gt;what-you-see-is-what-you-get (WYSIWYG)&lt;/a&gt; user interface to create GUIs for your PyQt applications productively and efficiently. With this tool, you create GUIs by dragging and dropping &lt;a href=&quot;https://doc.qt.io/qt-5/qtwidgets-index.html&quot;&gt;&lt;code&gt;QWidget&lt;/code&gt;&lt;/a&gt; objects on an empty form. After that, you can arrange them into a coherent GUI using different layout managers.&lt;/p&gt;
&lt;p&gt;Qt Designer also allows you to preview your GUIs using different styles and resolutions, connect &lt;a href=&quot;https://www.riverbankcomputing.com/static/Docs/PyQt5/signals_slots.html&quot;&gt;signals and slots&lt;/a&gt;, create menus and toolbars, and more.&lt;/p&gt;
&lt;p&gt;Qt Designer is platform and programming language independent. It doesn’t produce code in any particular programming language, but it creates &lt;a href=&quot;https://doc.qt.io/qt-5/designer-ui-file-format.html&quot;&gt;&lt;code&gt;.ui&lt;/code&gt; files&lt;/a&gt;. These files are &lt;code&gt;XML&lt;/code&gt; files with detailed descriptions of how to generate Qt-based GUIs.&lt;/p&gt;
&lt;p&gt;You can translate the content of &lt;code&gt;.ui&lt;/code&gt; files into Python code with &lt;a href=&quot;https://www.riverbankcomputing.com/static/Docs/PyQt5/designer.html#pyuic5&quot;&gt;&lt;code&gt;pyuic5&lt;/code&gt;&lt;/a&gt;, which is a command-line tool that comes with PyQt. Then you can use this Python code in your GUI applications. You can also read &lt;code&gt;.ui&lt;/code&gt; files directly and load their content to generate the associated GUI.&lt;/p&gt;
&lt;h3 id=&quot;installing-and-running-qt-designer&quot;&gt;Installing and Running Qt Designer&lt;a class=&quot;headerlink&quot; href=&quot;#installing-and-running-qt-designer&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;There are several ways to get and install Qt Designer depending on your current platform. If you use Windows or Linux, then you can run the following commands from your terminal or 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;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;pip install pyqt5 pyqt5-tools
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here, you create a &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;Python virtual environment&lt;/a&gt;, activate it, and install &lt;code&gt;pyqt5&lt;/code&gt; and &lt;code&gt;pyqt5-tools&lt;/code&gt;. &lt;code&gt;pyqt5&lt;/code&gt; installs PyQt and a copy of the required Qt libraries, while &lt;code&gt;pyqt5-tools&lt;/code&gt; installs a set of Qt tools that includes Qt Designer.&lt;/p&gt;
&lt;p&gt;The installation will place the Qt Designer executable in a different directory according to your platform:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Linux:&lt;/strong&gt; &lt;code&gt;...lib/python3.x/site-packages/qt5_applications/Qt/bin/designer&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Windows:&lt;/strong&gt; &lt;code&gt;...Lib\site-packages\pyqt5_tools\designer.exe&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On Linux systems, such as Debian and Ubuntu, you can also install Qt Designer by using the system package manager with the following command:&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;sudo apt install qttools5-dev-tools
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This command downloads and installs Qt Designer and other Qt tools on your system. In other words, you’ll have a system-wide installation and you’ll be able to run Qt Designer by clicking its icon in a file manager or system menu.&lt;/p&gt;
&lt;p&gt;On macOS, if you’ve installed &lt;a href=&quot;https://formulae.brew.sh/formula/qt&quot;&gt;Qt from Homebrew&lt;/a&gt; using the &lt;code&gt;brew install qt&lt;/code&gt; command, then you should have Qt Designer already installed on your system.&lt;/p&gt;
&lt;p&gt;Finally, you can download the Qt installer for your current platform from the &lt;a href=&quot;https://www.qt.io/download-qt-installer&quot;&gt;official download site&lt;/a&gt; and then follow the on-screen instructions. In this case, to complete the installation process, you need to &lt;a href=&quot;https://login.qt.io/register&quot;&gt;register a Qt account&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you’ve already installed Qt Designer using one of the options discussed so far, then go ahead and launch the application. You should get the following two windows on your screen:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/qt-designer-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/qt-designer-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>Plot With Pandas: Python Data Visualization Basics</title>
      <id>https://realpython.com/courses/plot-pandas-data-visualization/</id>
      <link href="https://realpython.com/courses/plot-pandas-data-visualization/"/>
      <updated>2021-02-02T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll get to know the basic plotting possibilities that Python provides in the popular data analysis library pandas. You&#x27;ll learn about the different kinds of plots that pandas offers, how to use them for data exploration, and which types of plots are best for certain use cases.</summary>
      <content type="html">
        &lt;p&gt;Whether you&amp;rsquo;re just getting to know a dataset or preparing to publish your findings, &lt;strong&gt;visualization&lt;/strong&gt; is an essential tool. Python&amp;rsquo;s popular data analysis library, &lt;a href=&quot;https://pandas.pydata.org/about/&quot;&gt;pandas&lt;/a&gt;, provides several different options for visualizing your data with &lt;code&gt;.plot()&lt;/code&gt;. Even if you&amp;rsquo;re at the beginning of your pandas journey, you&amp;rsquo;ll soon be creating basic plots that will yield valuable insights into your data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What the different types of &lt;strong&gt;pandas plots&lt;/strong&gt; are and when to use them&lt;/li&gt;
&lt;li&gt;How to get an overview of your dataset with a &lt;strong&gt;histogram&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to discover correlation with a &lt;strong&gt;scatter plot&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to analyze different &lt;strong&gt;categories&lt;/strong&gt; and their &lt;strong&gt;ratios&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #45: Processing Images in Python With Pillow</title>
      <id>https://realpython.com/podcasts/rpp/45/</id>
      <link href="https://realpython.com/podcasts/rpp/45/"/>
      <updated>2021-01-29T12:00:00+00:00</updated>
      <summary>Are you interested in processing images in Python? Do you need to load and modify images for your Flask or Django website or CMS? Then you most likely will be working with Pillow, the friendly fork of PIL, the Python imaging library. This week on the show, we have Mike Driscoll, who is writing a new book about image processing in Python.</summary>
      <content type="html">
        &lt;p&gt;Are you interested in processing images in Python? Do you need to load and modify images for your Flask or Django website or CMS? Then you most likely will be working with Pillow, the friendly fork of PIL, the Python imaging library. This week on the show, we have Mike Driscoll, who is writing a new book about image processing in Python.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Evaluate Expressions Dynamically With Python eval()</title>
      <id>https://realpython.com/courses/evaluate-expressions-dynamically-python-eval/</id>
      <link href="https://realpython.com/courses/evaluate-expressions-dynamically-python-eval/"/>
      <updated>2021-01-26T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn how Python&#x27;s eval() works and how to use it effectively in your programs. Additionally, you&#x27;ll learn how to minimize the security risks associated to the use of eval().</summary>
      <content type="html">
        &lt;p&gt;The built-in Python function &lt;code&gt;eval()&lt;/code&gt; is used to evaluate Python expressions. You can pass a string containing Python, or a pre-compiled object into &lt;code&gt;eval()&lt;/code&gt; and it will run the code and return the result. &lt;/p&gt;
&lt;p&gt;Although Python&amp;rsquo;s &lt;code&gt;eval()&lt;/code&gt; is an incredibly useful tool, the function has some important security implications that you should consider before using it. In this course, you&amp;rsquo;ll learn how &lt;code&gt;eval()&lt;/code&gt; works and how to use it safely and effectively in your Python programs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How Python&amp;rsquo;s &lt;strong&gt;&lt;code&gt;eval()&lt;/code&gt;&lt;/strong&gt; works&lt;/li&gt;
&lt;li&gt;How to use &lt;code&gt;eval()&lt;/code&gt; to &lt;strong&gt;dynamically evaluate&lt;/strong&gt; arbitrary string-based or compiled-code-based input&lt;/li&gt;
&lt;li&gt;How &lt;code&gt;eval()&lt;/code&gt; can make your code insecure and how to minimize the associated &lt;strong&gt;security risks&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The code in this course was tested with Python 3.9.0, &lt;code&gt;eval()&lt;/code&gt; has not changed much and older versions should be compatible.&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 #44: Creating an Interactive Online Python Conference for PyCascades 2021</title>
      <id>https://realpython.com/podcasts/rpp/44/</id>
      <link href="https://realpython.com/podcasts/rpp/44/"/>
      <updated>2021-01-22T12:00:00+00:00</updated>
      <summary>How do you create a virtual conference that retains the interactivity of an in-person event? What are the tools needed for talk submissions, ticketing, and live hosting? Can you find those tools written in Python? 
This week on the show, we have several of the organizers of the PyCascades 2021 conference. They share the process of restructuring a Python conference to meet those challenges.</summary>
      <content type="html">
        &lt;p&gt;How do you create a virtual conference that retains the interactivity of an in-person event? What are the tools needed for talk submissions, ticketing, and live hosting? Can you find those tools written in Python? 
This week on the show, we have several of the organizers of the PyCascades 2021 conference. They share the process of restructuring a Python conference to meet those challenges.&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>Introduction to Sorting Algorithms in Python</title>
      <id>https://realpython.com/courses/intro-sorting-algorithms/</id>
      <link href="https://realpython.com/courses/intro-sorting-algorithms/"/>
      <updated>2021-01-19T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn all about five different sorting algorithms in Python from both a theoretical and a practical standpoint. You&#x27;ll also learn several related and important concepts, including Big O notation and recursion.</summary>
      <content type="html">
        &lt;p&gt;&lt;strong&gt;Sorting&lt;/strong&gt; is a basic building block that many other algorithms are built upon. It&amp;rsquo;s related to several exciting ideas that you&amp;rsquo;ll see throughout your programming career. Understanding how sorting algorithms in Python work behind the scenes is a fundamental step toward implementing correct and efficient algorithms that solve real-world problems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How different &lt;strong&gt;sorting algorithms in Python&lt;/strong&gt; work and how they compare under different circumstances&lt;/li&gt;
&lt;li&gt;How &lt;strong&gt;Python&amp;rsquo;s built-in sort functionality&lt;/strong&gt; works behind the scenes&lt;/li&gt;
&lt;li&gt;How different computer science concepts like &lt;strong&gt;recursion&lt;/strong&gt; and &lt;strong&gt;divide and conquer&lt;/strong&gt; apply to sorting&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;Big O notation&lt;/strong&gt; is and how to use it to compare the efficiency of different algorithms&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 #43: Deep Reinforcement Learning in a Notebook With Jupylet + Gaming and Synthesis</title>
      <id>https://realpython.com/podcasts/rpp/43/</id>
      <link href="https://realpython.com/podcasts/rpp/43/"/>
      <updated>2021-01-15T12:00:00+00:00</updated>
      <summary>What is it like to design a Python library for three different audiences?  This week on the show, we have Nir Aides, creator of Jupylet. His new library is designed for deep reinforcement learning researchers, musicians interested in live music coding, and kids interested in learning to program. Everything is designed to run inside of a Jupyter notebook.</summary>
      <content type="html">
        &lt;p&gt;What is it like to design a Python library for three different audiences?  This week on the show, we have Nir Aides, creator of Jupylet. His new library is designed for deep reinforcement learning researchers, musicians interested in live music coding, and kids interested in learning to program. Everything is designed to run inside of a Jupyter notebook.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Managing Python Dependencies</title>
      <id>https://realpython.com/courses/managing-python-dependencies/</id>
      <link href="https://realpython.com/courses/managing-python-dependencies/"/>
      <updated>2021-01-12T14:00:00+00:00</updated>
      <summary>Get up to speed with Python dependency management quickly and go from “writing scripts” to “building applications” with this complete course.</summary>
      <content type="html">
        &lt;p&gt;&lt;em&gt;Managing Python Dependencies&lt;/em&gt; is your &amp;ldquo;one-stop shop&amp;rdquo; for picking up modern Python dependency management practices and workflows with minimal time investment.&lt;/p&gt;
&lt;p&gt;The course consists of 32 bite-sized video lessons, each focusing on a single concept. Progressing through the course, you’ll quickly build up a comprehensive knowledge of dependency management best practices in Python at your own, comfortable pace.&lt;/p&gt;
&lt;p&gt;Along the way, you’ll see hands on examples and step-by-step workflows that reinforce the skills you’re learning.&lt;/p&gt;
&lt;p&gt;By the end, you’ll know how to apply Python’s recommended dependency management tools, like pip, virtualenvs, and requirements files effectively in the most common day-to-day development scenarios on Linux, macOS, and Windows.&lt;/p&gt;
&lt;p&gt;With &lt;em&gt;Managing Python Dependencies&lt;/em&gt; you will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Code at a higher level and become more efficient&lt;/strong&gt;: Leveraging Python&amp;rsquo;s rich third-party library ecosystem let&amp;rsquo;s you write better programs in a shorter amount of time. With a large body of freely available modules you can avoid reinventing the wheel and deliver higher quality Python software, faster. This is a great way for you to demonstrate senior level skills that will benefit your development career.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Get up to speed with Python dependency management quickly&lt;/strong&gt;: Your time is your most important asset. If you can use it efficiently you will save your sanity—and a nice stack of money. This course is concise but thorough and will help you attain solid Python dependency management knowledge fast.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Go from &amp;ldquo;writing scripts&amp;rdquo; to &amp;ldquo;building applications&amp;rdquo; with Python&lt;/strong&gt;: By taking advantage of Python’s rich packaging ecosystem you’ll be able to build substantial and full-featured applications in Python. You’ll know the best practices for finding and documenting application dependencies that put you right on track for deploying and shipping production-grade apps.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Find great libraries for a specific task at hand&lt;/strong&gt;: This course teaches you a unique 7-step workflow for finding and identifying quality Python packages. Find out which libraries and tools are available on PyPI to help you. By quickly and easily identifying the correct libraries you’ll speed up your development efficiency by a large margin. Meet your deadlines and write better code at the same time by not having to &amp;ldquo;reinvent the wheel.&amp;rdquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Master &amp;ldquo;the tools of the trade&amp;rdquo; for dependency management&lt;/strong&gt;: With this course you’ll master the tools and workflows recommended by the official Python Packaging Authority. By getting those skills under your belt you’ll be ready to work with the Python development and production environments used by professional development teams across the world. Knowing these &amp;ldquo;tools of the trade&amp;rdquo; by heart puts you at an advantage in any job interview situation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&amp;ldquo;Productionize&amp;rdquo; your projects and share them with the world&lt;/strong&gt;: You’ll see how to apply the best practices for defining and installing package dependencies in Python. You&amp;rsquo;ll know how to get your programs ready to be deployed on production and automated testing environments and how to make it easy for other developers to contribute code with minimal setup effort.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Become more valuable as an employee and team member&lt;/strong&gt;: With my detailed 7-step workflow for researching quality Python packages you’ll know how to document and justify added program dependencies to your team and your manager. By taking on more responsibilities and picking up these senior-level &amp;ldquo;architectural&amp;rdquo; skills you’ll rise head and shoulders above other devs stuck at the &amp;ldquo;code monkey&amp;rdquo; level.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;who-is-this-course-for&quot;&gt;Who Is This Course For?&lt;a class=&quot;headerlink&quot; href=&quot;#who-is-this-course-for&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;This course is for Python developers&lt;/strong&gt; wanting to break through to the next phase of developing code by becoming more efficient, productive, and skilled using Python&amp;rsquo;s rich library ecosystem.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;ve ever caught yourself thinking &lt;em&gt;&amp;ldquo;There&amp;rsquo;s got to be a Python package out there that does exactly what I want&amp;hellip;But how do I find it?&amp;rdquo;&lt;/em&gt; this course will fill in the missing pieces for you.&lt;/p&gt;
&lt;p&gt;Discover the industry best practices around choosing and managing third-party dependencies for your Python 2 or Python 3 projects on Windows, macOS, and Linux.&lt;/p&gt;
&lt;p&gt;If you already know how to use alternative package managers like &lt;em&gt;Conda&lt;/em&gt; you&amp;rsquo;ll discover how to use the standards-compliant tools and workflows supported by any Python distribution and used in most production application deployments.&lt;/p&gt;
&lt;h2 id=&quot;course-goals&quot;&gt;Course Goals&lt;a class=&quot;headerlink&quot; href=&quot;#course-goals&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;By the end of the course you’ll know how to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Install, use, and manage third-party Python packages with the &amp;ldquo;pip&amp;rdquo; package manager on Windows, macOS, and Linux.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Isolate project dependencies with so-called virtual environments to avoid version conflicts in your Python projects.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Apply a complete 7-step workflow for finding and identifying quality third-party packages to use in your own Python projects (and justifying your decisions to your team or manager.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set up repeatable development environments and application deployments using the &amp;ldquo;pip&amp;rdquo; package manager and requirements files.&lt;/p&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 #42: What Is Data Engineering and Researching 10 Million Jupyter Notebooks</title>
      <id>https://realpython.com/podcasts/rpp/42/</id>
      <link href="https://realpython.com/podcasts/rpp/42/"/>
      <updated>2021-01-08T12:00:00+00:00</updated>
      <summary>Are you familiar with the role data engineers play in the modern landscape of data science and Python? Data engineering is a sub-discipline that focuses on the transportation, transformation, and storage of data.  This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Are you familiar with the role data engineers play in the modern landscape of data science and Python? Data engineering is a sub-discipline that focuses on the transportation, transformation, and storage of data.  This week on the show, David Amos is back, and he&#x27;s brought another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Building HTTP APIs With Django REST Framework</title>
      <id>https://realpython.com/courses/django-rest-framework/</id>
      <link href="https://realpython.com/courses/django-rest-framework/"/>
      <updated>2021-01-05T14:00:00+00:00</updated>
      <summary>This course will get you ready to build HTTP APIs with Django REST Framework. The Django REST framework (DRF) is a toolkit built on top of the Django web framework that reduces the amount of code you need to write to create REST interfaces.</summary>
      <content type="html">
        &lt;p&gt;REST is a loosely defined protocol for listing, creating, changing, and deleting data on your server over HTTP. The Django REST framework (DRF) is a toolkit built on top of the Django web framework that reduces the amount of code you need to write to create REST HTTP API interfaces.&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;The &lt;strong&gt;REST protocol&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;DRF &lt;strong&gt;&lt;code&gt;Serializers&lt;/code&gt;&lt;/strong&gt; and how to use them with Django objects&lt;/li&gt;
&lt;li&gt;Using Django &lt;code&gt;views&lt;/code&gt; and DRF &lt;code&gt;ViewSet&lt;/code&gt; classes to create REST &lt;strong&gt;end-points&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Multiple flavors of &lt;strong&gt;renderers&lt;/strong&gt; and how to control their output&lt;/li&gt;
&lt;li&gt;Specifying &lt;strong&gt;permissions&lt;/strong&gt; and limiting who can see what data in your REST API&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 #41: 2020 Real Python Articles in Review</title>
      <id>https://realpython.com/podcasts/rpp/41/</id>
      <link href="https://realpython.com/podcasts/rpp/41/"/>
      <updated>2020-12-25T12:00:00+00:00</updated>
      <summary>It&#x27;s been quite the year! The Real Python team has written, edited, curated, illustrated, and produced a mountain of Python articles this year. We also upgraded the site and membership with office hours, transcripts, this podcast, and much more. 

We are joined by two members of the Real Python team, David Amos and Joanna Jablonski. We wanted to share a year-end wrap-up with a collection of articles that showcase a diversity of Python topics and the quality of what our team created this year.</summary>
      <content type="html">
        &lt;p&gt;It&#x27;s been quite the year! The Real Python team has written, edited, curated, illustrated, and produced a mountain of Python articles this year. We also upgraded the site and membership with office hours, transcripts, this podcast, and much more. 

We are joined by two members of the Real Python team, David Amos and Joanna Jablonski. We wanted to share a year-end wrap-up with a collection of articles that showcase a diversity of Python topics and the quality of what our team created this year.&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>
