<?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-02-10T14:00:00+00:00</updated>
  <id>https://realpython.com/</id>
  <author>
    <name>Real Python</name>
  </author>

  
    <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>Python Web Applications: Deploy Your Script as a Flask App</title>
      <id>https://realpython.com/python-web-applications/</id>
      <link href="https://realpython.com/python-web-applications/"/>
      <updated>2021-02-01T19:49:55+00:00</updated>
      <summary>In this tutorial, you’ll learn how to go from a local Python script to a fully deployed Flask web application that you can share with the world.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;You wrote a Python script that you’re proud of, and now you want to show it off to the world. But &lt;em&gt;how&lt;/em&gt;? Most people won’t know what to do with your &lt;code&gt;.py&lt;/code&gt; file. Converting your script into a &lt;strong&gt;Python web application&lt;/strong&gt; is a great solution to make your code usable for a broad audience.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll learn how to go from a local Python script to a fully deployed Flask web application that you can share with the world.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll know:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;web applications&lt;/strong&gt; are and how you can &lt;strong&gt;host&lt;/strong&gt; them online&lt;/li&gt;
&lt;li&gt;How to convert a Python script into a &lt;strong&gt;Flask web application&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to improve user experience by &lt;strong&gt;adding HTML&lt;/strong&gt; to your Python code&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;deploy&lt;/strong&gt; your Python web application to &lt;strong&gt;Google App Engine&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition to walking through an example project, you’ll find a number of &lt;strong&gt;exercises&lt;/strong&gt; throughout the tutorial. They’ll give you a chance to solidify what you’re learning through extra practice. You can also download the source code that you’ll use to build your web 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 Sample Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-web-apps-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-web-apps-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get the sample code you’ll use&lt;/a&gt; to learn about creating Python web applications with Flask in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;brush-up-on-the-basics&quot;&gt;Brush Up on the Basics&lt;a class=&quot;headerlink&quot; href=&quot;#brush-up-on-the-basics&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this section, you’ll get a theoretical footing in the different topics that you’ll work with during the practical part of this tutorial:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What types of Python code distribution exist&lt;/li&gt;
&lt;li&gt;Why building a web application can be a good choice&lt;/li&gt;
&lt;li&gt;What a web application is&lt;/li&gt;
&lt;li&gt;How content gets delivered over the Internet&lt;/li&gt;
&lt;li&gt;What web hosting means&lt;/li&gt;
&lt;li&gt;Which hosting providers exist and which one to use&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Brushing up on these topics can help you feel more confident when writing Python code for the Web. However, if you’re already familiar with them, then feel free to skip ahead, &lt;a href=&quot;#choose-a-hosting-provider-google-app-engine&quot;&gt;install the Google Cloud SDK&lt;/a&gt;, and start building your Python web app.&lt;/p&gt;
&lt;h3 id=&quot;distribute-your-python-code&quot;&gt;Distribute Your Python Code&lt;a class=&quot;headerlink&quot; href=&quot;#distribute-your-python-code&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Bringing your code to your users is called &lt;strong&gt;distribution&lt;/strong&gt;. Traditionally, there are three different approaches you can use to distribute your code so that others can work with your programs:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Python library&lt;/li&gt;
&lt;li&gt;Standalone program&lt;/li&gt;
&lt;li&gt;Python web application&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You’ll take a closer look at each of these approaches below.&lt;/p&gt;
&lt;h4 id=&quot;python-library&quot;&gt;Python Library&lt;a class=&quot;headerlink&quot; href=&quot;#python-library&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;If you’ve worked with Python’s extensive package ecosystem, then you’ve likely installed &lt;a href=&quot;https://realpython.com/python-modules-packages/&quot;&gt;Python packages&lt;/a&gt; with &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;. As a programmer, you might want to &lt;a href=&quot;https://realpython.com/pypi-publish-python-package/&quot;&gt;publish your Python package on PyPI&lt;/a&gt; to allow other users to access and use your code by installing it using &lt;code&gt;pip&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python3 -m pip install &amp;lt;your-package-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After you’ve successfully published your code to PyPI, this command will install your package, including its dependencies, on any of your users’ computers, provided that they have an Internet connection.&lt;/p&gt;
&lt;p&gt;If you don’t want to publish your code as a PyPI package, then you can still use Python’s built-in &lt;code&gt;sdist&lt;/code&gt; command to create a &lt;a href=&quot;https://docs.python.org/3/distutils/sourcedist.html&quot;&gt;source distribution&lt;/a&gt; or a &lt;a href=&quot;https://realpython.com/python-wheels/&quot;&gt;Python wheel&lt;/a&gt; to create a &lt;a href=&quot;https://packaging.python.org/glossary/#term-built-distribution&quot;&gt;built distribution&lt;/a&gt; to share with your users.&lt;/p&gt;
&lt;p&gt;Distributing your code like this keeps it close to the original script you wrote and adds only what’s necessary for others to run it. However, using this approach also means that your users will need to run your code with Python. Many people who want to use your script’s functionality won’t have Python installed or won’t be familiar with the processes required to work directly with your code.&lt;/p&gt;
&lt;p&gt;A more user-friendly way to present your code to potential users is to build a standalone program.&lt;/p&gt;
&lt;h4 id=&quot;standalone-program&quot;&gt;Standalone Program&lt;a class=&quot;headerlink&quot; href=&quot;#standalone-program&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Computer programs come in different shapes and forms, and there are multiple options for transforming your Python scripts into standalone programs. Below you’ll read about two possibilities:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Packaging your code&lt;/li&gt;
&lt;li&gt;Building a GUI&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Programs such as &lt;a href=&quot;https://www.pyinstaller.org/&quot;&gt;PyInstaller&lt;/a&gt;, &lt;a href=&quot;https://py2app.readthedocs.io/en/latest/&quot;&gt;py2app&lt;/a&gt;, &lt;a href=&quot;https://www.py2exe.org/&quot;&gt;py2exe&lt;/a&gt;, or &lt;a href=&quot;https://briefcase.readthedocs.io/en/latest/&quot;&gt;Briefcase&lt;/a&gt; can help with packaging your code. They turn Python scripts into executable programs that can be used on different platforms without requiring your users to explicitly run the Python interpreter.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-web-applications/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-web-applications/ »&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 #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>Stochastic Gradient Descent Algorithm With Python and NumPy</title>
      <id>https://realpython.com/gradient-descent-algorithm-python/</id>
      <link href="https://realpython.com/gradient-descent-algorithm-python/"/>
      <updated>2021-01-27T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn what the stochastic gradient descent algorithm is, how it works, and how to implement it with Python and NumPy.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Stochastic_gradient_descent&quot;&gt;&lt;strong&gt;Stochastic gradient descent&lt;/strong&gt;&lt;/a&gt; is an optimization algorithm often used in machine learning applications to find the model parameters that correspond to the best fit between predicted and actual outputs. It’s an inexact but powerful technique.&lt;/p&gt;
&lt;p&gt;Stochastic gradient descent is widely used in machine learning applications. Combined with &lt;a href=&quot;https://brilliant.org/wiki/backpropagation/&quot;&gt;backpropagation&lt;/a&gt;, it’s dominant in &lt;a href=&quot;https://realpython.com/python-keras-text-classification/#a-primer-on-deep-neural-networks&quot;&gt;neural network&lt;/a&gt; training applications.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How &lt;strong&gt;gradient descent&lt;/strong&gt; and &lt;strong&gt;stochastic gradient descent&lt;/strong&gt; algorithms work&lt;/li&gt;
&lt;li&gt;How to apply gradient descent and stochastic gradient descent to &lt;strong&gt;minimize the loss function&lt;/strong&gt; in machine learning&lt;/li&gt;
&lt;li&gt;What the &lt;strong&gt;learning rate&lt;/strong&gt; is, why it’s important, and how it impacts results&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;write your own function&lt;/strong&gt; for stochastic gradient descent&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;basic-gradient-descent-algorithm&quot;&gt;Basic Gradient Descent Algorithm&lt;a class=&quot;headerlink&quot; href=&quot;#basic-gradient-descent-algorithm&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;https://en.wikipedia.org/wiki/Gradient_descent&quot;&gt;gradient descent algorithm&lt;/a&gt; is an approximate and iterative method for &lt;a href=&quot;https://en.wikipedia.org/wiki/Mathematical_optimization&quot;&gt;mathematical optimization&lt;/a&gt;. You can use it to approach the minimum of any &lt;a href=&quot;https://en.wikipedia.org/wiki/Differentiable_function&quot;&gt;differentiable function&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; There are many optimization methods and &lt;a href=&quot;https://en.wikipedia.org/wiki/Mathematical_optimization#Major_subfields&quot;&gt;subfields of mathematical programming&lt;/a&gt;. If you want to learn how to use some of them with Python, then check out &lt;a href=&quot;https://realpython.com/python-scipy-cluster-optimize/&quot;&gt;Scientific Python: Using SciPy for Optimization&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/linear-programming-python/&quot;&gt;Hands-On Linear Programming: Optimization With Python&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Although gradient descent sometimes gets stuck in a &lt;a href=&quot;https://en.wikipedia.org/wiki/Local_optimum&quot;&gt;local minimum&lt;/a&gt; or a &lt;a href=&quot;https://en.wikipedia.org/wiki/Saddle_point&quot;&gt;saddle point&lt;/a&gt; instead of finding the global minimum, it’s widely used in practice. &lt;a href=&quot;https://realpython.com/learning-paths/data-science-python-core-skills/&quot;&gt;Data science&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/learning-paths/machine-learning-python/&quot;&gt;machine learning&lt;/a&gt; methods often apply it internally to optimize model parameters. For example, neural networks find &lt;a href=&quot;https://docs.paperspace.com/machine-learning/wiki/weights-and-biases&quot;&gt;weights and biases&lt;/a&gt; with gradient descent.&lt;/p&gt;
&lt;h3 id=&quot;cost-function-the-goal-of-optimization&quot;&gt;Cost Function: The Goal of Optimization&lt;a class=&quot;headerlink&quot; href=&quot;#cost-function-the-goal-of-optimization&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;cost function&lt;/strong&gt;, or &lt;a href=&quot;https://en.wikipedia.org/wiki/Loss_function&quot;&gt;loss function&lt;/a&gt;, is the function to be minimized (or maximized) by varying the decision variables. Many machine learning methods solve optimization problems under the surface. They tend to minimize the difference between actual and predicted outputs by adjusting the model parameters (like weights and biases for &lt;a href=&quot;https://en.wikipedia.org/wiki/Artificial_neural_network&quot;&gt;neural networks&lt;/a&gt;, decision rules for &lt;a href=&quot;https://en.wikipedia.org/wiki/Random_forest&quot;&gt;random forest&lt;/a&gt; or &lt;a href=&quot;https://en.wikipedia.org/wiki/Gradient_boosting&quot;&gt;gradient boosting&lt;/a&gt;, and so on).&lt;/p&gt;
&lt;p&gt;In a &lt;a href=&quot;https://realpython.com/linear-regression-in-python/#regression&quot;&gt;regression problem&lt;/a&gt;, you typically have the vectors of input variables 𝐱 = (𝑥₁, …, 𝑥ᵣ) and the actual outputs 𝑦. You want to find a model that maps 𝐱 to a predicted response 𝑓(𝐱) so that 𝑓(𝐱) is as close as possible to 𝑦. For example, you might want to predict an output such as a person’s salary given inputs like the person’s number of years at the company or level of education.&lt;/p&gt;
&lt;p&gt;Your goal is to minimize the difference between the prediction 𝑓(𝐱) and the actual data 𝑦. This difference is called the &lt;strong&gt;residual&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In this type of problem, you want to minimize the &lt;a href=&quot;https://en.wikipedia.org/wiki/Residual_sum_of_squares&quot;&gt;sum of squared residuals (SSR)&lt;/a&gt;, where SSR = Σᵢ(𝑦ᵢ − 𝑓(𝐱ᵢ))² for all observations 𝑖 = 1, …, 𝑛, where 𝑛 is the total number of observations. Alternatively, you could use the &lt;a href=&quot;https://en.wikipedia.org/wiki/Mean_squared_error&quot;&gt;mean squared error&lt;/a&gt; (MSE = SSR / 𝑛) instead of SSR.&lt;/p&gt;
&lt;p&gt;Both SSR and MSE use the square of the difference between the actual and predicted outputs. The lower the difference, the more accurate the prediction. A difference of zero indicates that the prediction is equal to the actual data.&lt;/p&gt;
&lt;p&gt;SSR or MSE is minimized by adjusting the model parameters. For example, in &lt;a href=&quot;https://realpython.com/linear-regression-in-python/&quot;&gt;linear regression&lt;/a&gt;, you want to find the function 𝑓(𝐱) = 𝑏₀ + 𝑏₁𝑥₁ + ⋯ + 𝑏ᵣ𝑥ᵣ, so you need to determine the weights 𝑏₀, 𝑏₁, …, 𝑏ᵣ that minimize SSR or MSE.&lt;/p&gt;
&lt;p&gt;In a &lt;a href=&quot;https://realpython.com/logistic-regression-python/#classification&quot;&gt;classification problem&lt;/a&gt;, the outputs 𝑦 are &lt;a href=&quot;https://en.wikipedia.org/wiki/Categorical_variable&quot;&gt;categorical&lt;/a&gt;, often either 0 or 1. For example, you might try to predict whether an email is spam or not. In the case of binary outputs, it’s convenient to minimize the &lt;a href=&quot;https://en.wikipedia.org/wiki/Cross_entropy&quot;&gt;cross-entropy function&lt;/a&gt; that also depends on the actual outputs 𝑦ᵢ and the corresponding predictions 𝑝(𝐱ᵢ):&lt;/p&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/mmst-gda-eqs-1.119ab87cc186.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-66&quot; src=&quot;https://files.realpython.com/media/mmst-gda-eqs-1.119ab87cc186.png&quot; width=&quot;1816&quot; height=&quot;194&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/mmst-gda-eqs-1.119ab87cc186.png&amp;amp;w=454&amp;amp;sig=e6d8b3e4d147738a8c0ccebf2e4747b5b63b74a9 454w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/mmst-gda-eqs-1.119ab87cc186.png&amp;amp;w=908&amp;amp;sig=1558fcfcdbaf30b23a55ae380291769b090d1194 908w, https://files.realpython.com/media/mmst-gda-eqs-1.119ab87cc186.png 1816w&quot; sizes=&quot;75vw&quot; alt=&quot;mmst-gda-eqs-1&quot; data-asset=&quot;3400&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;In &lt;a href=&quot;https://realpython.com/logistic-regression-python/&quot;&gt;logistic regression&lt;/a&gt;, which is often used to solve classification problems, the functions 𝑝(𝐱) and 𝑓(𝐱) are defined as the following:&lt;/p&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/mmst-gda-eqs-2.76aa15da2cc0.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-66&quot; src=&quot;https://files.realpython.com/media/mmst-gda-eqs-2.76aa15da2cc0.png&quot; width=&quot;1820&quot; height=&quot;317&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/mmst-gda-eqs-2.76aa15da2cc0.png&amp;amp;w=455&amp;amp;sig=8d933a1259c626545ac1760d9fdbb509c1efe61e 455w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/mmst-gda-eqs-2.76aa15da2cc0.png&amp;amp;w=910&amp;amp;sig=c961e1c3c89347d7084083609cb267b54dfb67be 910w, https://files.realpython.com/media/mmst-gda-eqs-2.76aa15da2cc0.png 1820w&quot; sizes=&quot;75vw&quot; alt=&quot;mmst-gda-eqs-2&quot; data-asset=&quot;3401&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Again, you need to find the weights 𝑏₀, 𝑏₁, …, 𝑏ᵣ, but this time they should minimize the cross-entropy function.&lt;/p&gt;
&lt;h3 id=&quot;gradient-of-a-function-calculus-refresher&quot;&gt;Gradient of a Function: Calculus Refresher&lt;a class=&quot;headerlink&quot; href=&quot;#gradient-of-a-function-calculus-refresher&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In calculus, the &lt;a href=&quot;https://www.mathsisfun.com/calculus/derivatives-introduction.html&quot;&gt;derivative&lt;/a&gt; of a function shows you how much a value changes when you modify its argument (or arguments). Derivatives are important for optimization because the &lt;a href=&quot;http://sofia.nmsu.edu/~breakingaway/ebookofcalculus/MeaningOfDerivativesAndIntegrals/WhatDoesItMeanThatTheDerivativeOfAFunctionEquals0/WhatDoesItMeanThatTheDerivativeOfAFunctionEquals0.html&quot;&gt;zero derivatives&lt;/a&gt; might indicate a minimum, maximum, or saddle point.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://en.wikipedia.org/wiki/Gradient&quot;&gt;gradient&lt;/a&gt; of a function 𝐶 of several independent variables 𝑣₁, …, 𝑣ᵣ is denoted with ∇𝐶(𝑣₁, …, 𝑣ᵣ) and defined as the vector function of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Partial_derivative&quot;&gt;partial derivatives&lt;/a&gt; of 𝐶 with respect to each independent variable: ∇𝐶 = (∂𝐶/∂𝑣₁, …, ∂𝐶/𝑣ᵣ). The symbol ∇ is called &lt;a href=&quot;https://en.wikipedia.org/wiki/Nabla_symbol&quot;&gt;nabla&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The nonzero value of the gradient of a function 𝐶 at a given point defines the direction and rate of the fastest increase of 𝐶. When working with gradient descent, you’re interested in the direction of the fastest &lt;em&gt;decrease&lt;/em&gt; in the cost function. This direction is determined by the negative gradient, −∇𝐶.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/gradient-descent-algorithm-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/gradient-descent-algorithm-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>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>How to Use Python: Your First Steps</title>
      <id>https://realpython.com/python-first-steps/</id>
      <link href="https://realpython.com/python-first-steps/"/>
      <updated>2021-01-25T16:27:13+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn the basics of how to use Python. With this knowledge, you&#x27;ll be able to start coding your Python applications.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Are you looking for a place to learn the basics of how to use &lt;a href=&quot;https://realpython.com/learning-paths/python3-introduction/&quot;&gt;Python from a beginner’s perspective&lt;/a&gt;? Do you want to get up and running with Python but don’t know where to start? If so, then this tutorial is for you. This tutorial focuses on the essentials you need to know to start programming with Python.&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;Python&lt;/strong&gt; is and why you should use it&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;basic Python syntax&lt;/strong&gt; you should learn to start coding&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;handle errors&lt;/strong&gt; in Python&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;get help&lt;/strong&gt; quickly in Python&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;code style&lt;/strong&gt; you should apply in your code&lt;/li&gt;
&lt;li&gt;Where to get &lt;strong&gt;extra functionalities&lt;/strong&gt; without reinventing the wheel&lt;/li&gt;
&lt;li&gt;Where to find quality Python content and &lt;strong&gt;grow your skills&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll also have the opportunity to create your first Python program and &lt;a href=&quot;https://realpython.com/run-python-scripts/&quot;&gt;run it on your computer&lt;/a&gt;. Finally, you’ll have a chance to evaluate your progress with a quiz that’ll give you an idea of how much you’ve learned.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-cheat-sheet-experiment&quot; data-focus=&quot;false&quot;&gt;Click here to get our free Python Cheat Sheet&lt;/a&gt; that shows you the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;why-you-should-use-python&quot;&gt;Why You Should Use Python&lt;a class=&quot;headerlink&quot; href=&quot;#why-you-should-use-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/pythonlogo.0658b34b4498.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid w-25 float-right&quot; src=&quot;https://files.realpython.com/media/pythonlogo.0658b34b4498.jpg&quot; width=&quot;680&quot; height=&quot;459&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/pythonlogo.0658b34b4498.jpg&amp;amp;w=170&amp;amp;sig=ac227e7d70841aa87fe92a62acbdddf6938350eb 170w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/pythonlogo.0658b34b4498.jpg&amp;amp;w=340&amp;amp;sig=1afd2a88fd379da035a4734b3e5d8616075dcf22 340w, https://files.realpython.com/media/pythonlogo.0658b34b4498.jpg 680w&quot; sizes=&quot;75vw&quot; alt=&quot;The Python Logo. The Python logo is a trademark of the Python Software Foundation.&quot; data-asset=&quot;183&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Python, named after the British comedy group &lt;a href=&quot;https://en.wikipedia.org/wiki/Monty_Python&quot;&gt;Monty Python&lt;/a&gt;, is a &lt;strong&gt;high-level&lt;/strong&gt;, &lt;strong&gt;interpreted&lt;/strong&gt;, &lt;strong&gt;interactive&lt;/strong&gt;, and &lt;strong&gt;object-oriented&lt;/strong&gt; programming language. Its flexibility allows you to do &lt;a href=&quot;https://realpython.com/what-can-i-do-with-python/&quot;&gt;many things&lt;/a&gt;, both big and small. With Python, you can write basic programs and scripts and also to create complex and large-scale enterprise solutions. Here’s a sampling of its uses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Building desktop applications, including &lt;a href=&quot;https://realpython.com/learning-paths/python-gui-programming/&quot;&gt;GUI applications&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/command-line-interfaces-python-argparse/&quot;&gt;CLI tools&lt;/a&gt;, and even &lt;a href=&quot;https://realpython.com/pygame-a-primer/&quot;&gt;games&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Doing &lt;a href=&quot;https://realpython.com/learning-paths/math-data-science/&quot;&gt;mathematical&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/learning-paths/data-science-python-core-skills/&quot;&gt;scientific&lt;/a&gt; analysis of data&lt;/li&gt;
&lt;li&gt;Building &lt;a href=&quot;https://realpython.com/learning-paths/become-python-web-developer/&quot;&gt;web&lt;/a&gt; and Internet applications&lt;/li&gt;
&lt;li&gt;Doing computer systems administration and automating tasks&lt;/li&gt;
&lt;li&gt;Performing &lt;a href=&quot;https://realpython.com/tutorials/devops/&quot;&gt;DevOps&lt;/a&gt; tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can find Python everywhere in the world of computer programming. For example, Python is the foundation of some of the world’s &lt;a href=&quot;https://realpython.com/world-class-companies-using-python/&quot;&gt;most popular websites&lt;/a&gt;, including Reddit, Dropbox, and YouTube, to name a few. The Python web framework &lt;a href=&quot;https://realpython.com/learning-paths/django-web-development/&quot;&gt;Django&lt;/a&gt; powers both &lt;a href=&quot;https://www.instagram.com/&quot;&gt;Instagram&lt;/a&gt; and &lt;a href=&quot;https://pinterest.com/&quot;&gt;Pinterest&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Python has a bunch of features that make it attractive as your first programming language:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Free:&lt;/strong&gt; Python is available free of charge, even for commercial purposes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open source:&lt;/strong&gt; Anyone can contribute to Python development.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessible:&lt;/strong&gt; People of all ages, from school children to retirees, have learned Python, and so can you.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Versatile:&lt;/strong&gt; Python can help you solve problems in many fields, including scripting, data science, web development, GUI development, and more.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Powerful:&lt;/strong&gt; You can code small scripts to automate repetitive tasks, and you can also create complex and large-scale enterprise solutions with Python.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Compared to other programming languages, Python has the following features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Interpreted:&lt;/strong&gt; It’s portable and quicker to experiment with than compiled languages.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiparadigm:&lt;/strong&gt; It lets you write code in different styles, including &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/Imperative_programming&quot;&gt;imperative&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-reduce-function/&quot;&gt;functional&lt;/a&gt; style.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dynamically typed:&lt;/strong&gt; It checks &lt;a href=&quot;https://realpython.com/python-variables/&quot;&gt;variable&lt;/a&gt; types at runtime, so you don’t need to declare them explicitly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Strongly typed:&lt;/strong&gt; It won’t let unsafe operations on incompatible types go unnoticed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There’s a lot more to learn about Python. But by now, you should have a better idea of why Python is so popular and why you should consider learning to program with it.&lt;/p&gt;
&lt;h2 id=&quot;how-to-download-and-install-python&quot;&gt;How to Download and Install Python&lt;a class=&quot;headerlink&quot; href=&quot;#how-to-download-and-install-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Python works on Linux, Mac, Windows, and several other platforms. It comes preinstalled on macOS and on most Linux distributions. However, if you want to be up to date, then you probably need to download and install the latest version. You also have the choice of using &lt;a href=&quot;https://realpython.com/intro-to-pyenv/&quot;&gt;different Python versions&lt;/a&gt; in different projects if you want to.&lt;/p&gt;
&lt;p&gt;To check what Python version has been installed globally in your operating system, open the terminal or command line and run 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;python3 -V
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This command prints the version of your system’s default Python 3 installation. Note that you use &lt;code&gt;python3&lt;/code&gt; instead of &lt;code&gt;python&lt;/code&gt; because some operating systems still include Python 2 as their default Python installation.&lt;/p&gt;
&lt;h3 id=&quot;installing-python-from-binaries&quot;&gt;Installing Python From Binaries&lt;a class=&quot;headerlink&quot; href=&quot;#installing-python-from-binaries&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Regardless of your operating system, you can download an appropriate version of Python from the &lt;a href=&quot;https://www.python.org/&quot;&gt;official site&lt;/a&gt;. Go there and grab the appropriate 32-bit or 64-bit version for your operating system and processor.&lt;/p&gt;
&lt;p&gt;Selecting and downloading a Python binary from the language’s official site is often a good choice. However, there are some OS-specific alternatives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;macOS:&lt;/strong&gt; You have the option of &lt;a href=&quot;https://realpython.com/installing-python/#what-your-options-are_1&quot;&gt;installing Python&lt;/a&gt; from &lt;a href=&quot;http://brew.sh/&quot;&gt;Homebrew&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux:&lt;/strong&gt; You can install several Python versions using your distribution’s package manager.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Windows:&lt;/strong&gt; You can install Python from the &lt;a href=&quot;https://www.microsoft.com/en-ca/search?q=python&quot;&gt;Microsoft Store&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also use the &lt;a href=&quot;https://www.anaconda.com/products/individual&quot;&gt;Anaconda distribution&lt;/a&gt; to install Python along with a rich set of packages and libraries, or you can use &lt;a href=&quot;https://docs.conda.io/en/latest/miniconda.html&quot;&gt;Miniconda&lt;/a&gt; if you want to install only the packages you need.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-first-steps/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-first-steps/ »&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 #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>C for Python Programmers</title>
      <id>https://realpython.com/c-for-python-programmers/</id>
      <link href="https://realpython.com/c-for-python-programmers/"/>
      <updated>2021-01-20T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn the basics of the C language, which is used in the source code for CPython, the most popular Python implementation. Learning C is important for Python programmers interested in contributing to CPython.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The purpose of this tutorial is to get an experienced Python programmer up to speed with the basics of the &lt;a href=&quot;https://en.wikipedia.org/wiki/C_(programming_language)&quot;&gt;C language&lt;/a&gt; and how it’s used in the &lt;a href=&quot;https://en.wikipedia.org/wiki/CPython&quot;&gt;CPython&lt;/a&gt; source code. It assumes you already have an intermediate understanding of Python syntax.&lt;/p&gt;
&lt;p&gt;That said, C is a fairly limited language, and most of its usage in CPython falls under a small set of syntax rules. Getting to the point where you understand the code is a much smaller step than being able to write C effectively. This tutorial is aimed at the first goal but not the second.&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;C preprocessor&lt;/strong&gt; is and what role it plays in building C programs&lt;/li&gt;
&lt;li&gt;How you can use &lt;strong&gt;preprocessor directives&lt;/strong&gt; to manipulate source files&lt;/li&gt;
&lt;li&gt;How &lt;strong&gt;C syntax&lt;/strong&gt; compares to &lt;strong&gt;Python syntax&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to create &lt;strong&gt;loops&lt;/strong&gt;, &lt;strong&gt;functions&lt;/strong&gt;, &lt;strong&gt;strings&lt;/strong&gt;, and other features in C&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One of the first things that stands out as a big difference between Python and C is the C preprocessor. You’ll look at that first.&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 adapted from the appendix, “Introduction to C for Python Programmers,” in &lt;a href=&quot;https://realpython.com/products/cpython-internals-book/&quot;&gt;&lt;em&gt;CPython Internals: Your Guide to the Python Interpreter&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/cpython-internals-sample/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-cpython-internals-sample&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Get a sample chapter from CPython Internals: Your Guide to the Python 3 Interpreter&lt;/a&gt; showing you how to unlock the inner workings of the Python language, compile the Python interpreter from source  code, and participate in the development of CPython.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-c-preprocessor&quot;&gt;The C Preprocessor&lt;a class=&quot;headerlink&quot; href=&quot;#the-c-preprocessor&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The preprocessor, as the name suggests, is run on your source files before the compiler runs. It has very limited abilities, but you can use them to great advantage in building C programs.&lt;/p&gt;
&lt;p&gt;The preprocessor produces a new file, which is what the compiler will actually process. All the commands to the preprocessor start at the beginning of a line, with a &lt;code&gt;#&lt;/code&gt; symbol as the first non-whitespace character.&lt;/p&gt;
&lt;p&gt;The main purpose of the preprocessor is to do text substitution in the source file, but it will also do some basic conditional code with &lt;code&gt;#if&lt;/code&gt; or similar statements.&lt;/p&gt;
&lt;p&gt;You’ll start with the most frequent preprocessor directive: &lt;code&gt;#include&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;include&quot;&gt;&lt;code&gt;#include&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#include&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;#include&lt;/code&gt; is used to pull the contents of one file into the current source file. There’s nothing sophisticated about &lt;code&gt;#include&lt;/code&gt;. It reads a file from the file system, runs the preprocessor on that file, and puts the results into the output file. This is done recursively for each &lt;code&gt;#include&lt;/code&gt; directive.&lt;/p&gt;
&lt;p&gt;For example, if you look at CPython’s &lt;a href=&quot;https://github.com/python/cpython/blob/master/Modules/_multiprocessing/semaphore.c&quot;&gt;&lt;code&gt;Modules/_multiprocessing/semaphore.c&lt;/code&gt; file&lt;/a&gt;, then near the top you’ll see the following line:&lt;/p&gt;
&lt;div class=&quot;highlight c&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&quot;multiprocessing.h&quot;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This tells the preprocessor to pull in the entire contents of &lt;code&gt;multiprocessing.h&lt;/code&gt; and put them into the output file at this position.&lt;/p&gt;
&lt;p&gt;You’ll notice two different forms for the &lt;code&gt;#include&lt;/code&gt; statement. One of them uses quotes (&lt;code&gt;&quot;&quot;&lt;/code&gt;) to specify the name of the include file, and the other uses angle brackets (&lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt;). The difference comes from which paths are searched when looking for the file on the file system.&lt;/p&gt;
&lt;p&gt;If you use &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; for the filename, then the preprocessor will look only at system include files. Using quotes around the filename instead will force the preprocessor to look in the local directory first and then fall back to the system directories.&lt;/p&gt;
&lt;h3 id=&quot;define&quot;&gt;&lt;code&gt;#define&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#define&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;#define&lt;/code&gt; allows you to do simple text substitution and also plays into the &lt;code&gt;#if&lt;/code&gt; directives you’ll see below.&lt;/p&gt;
&lt;p&gt;At its most basic, &lt;code&gt;#define&lt;/code&gt; lets you define a new symbol that gets replaced with a text string in the preprocessor output.&lt;/p&gt;
&lt;p&gt;Continuing in &lt;code&gt;semphore.c&lt;/code&gt;, you’ll find this line:&lt;/p&gt;
&lt;div class=&quot;highlight c&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#define SEM_FAILED NULL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This tells the preprocessor to replace every instance of &lt;code&gt;SEM_FAILED&lt;/code&gt; below this point with the literal string &lt;code&gt;NULL&lt;/code&gt; before the code is sent to the compiler.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/c-for-python-programmers/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/c-for-python-programmers/ »&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>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>Make Your First Python Game: Rock, Paper, Scissors!</title>
      <id>https://realpython.com/python-rock-paper-scissors/</id>
      <link href="https://realpython.com/python-rock-paper-scissors/"/>
      <updated>2021-01-18T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn to program rock paper scissors in Python from scratch. You&#x27;ll learn how to take in user input, make the computer choose a random action, determine a winner, and split your code into functions.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Game programming is a great way to learn how to program. You use many tools that you’ll see in the real world, plus you get to play a game to test your results! An ideal game to start your Python game programming journey is &lt;a href=&quot;https://en.wikipedia.org/wiki/Rock_paper_scissors&quot;&gt;rock paper scissors&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Code your own &lt;strong&gt;rock paper scissors&lt;/strong&gt; game &lt;/li&gt;
&lt;li&gt;Take in user input with &lt;strong&gt;&lt;code&gt;input()&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Play several games in a row using a &lt;strong&gt;&lt;code&gt;while&lt;/code&gt; loop&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Clean up your code with &lt;strong&gt;&lt;code&gt;Enum&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;functions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Define more complex rules with a &lt;strong&gt;dictionary&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-rock-paper-scissors&quot;&gt;What Is Rock Paper Scissors?&lt;a class=&quot;headerlink&quot; href=&quot;#what-is-rock-paper-scissors&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You may have played rock paper scissors before. Maybe you’ve used it to decide who pays for dinner or who gets first choice of players for a team.&lt;/p&gt;
&lt;p&gt;If you’re unfamiliar, rock paper scissors is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Hand_game&quot;&gt;hand game&lt;/a&gt; for two or more players. Participants say “rock, paper, scissors” and then simultaneously form their hands into the shape of a rock (a fist), a piece of paper (palm facing downward), or a pair of scissors (two fingers extended). The rules are straightforward: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Rock&lt;/strong&gt; smashes scissors. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paper&lt;/strong&gt; covers rock.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scissors&lt;/strong&gt; cut paper.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now that you have the rules down, you can start thinking about how they might translate to Python code. &lt;/p&gt;
&lt;h2 id=&quot;play-a-single-game-of-rock-paper-scissors-in-python&quot;&gt;Play a Single Game of Rock Paper Scissors in Python&lt;a class=&quot;headerlink&quot; href=&quot;#play-a-single-game-of-rock-paper-scissors-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Using the description and rules above, you can make a game of rock paper scissors. Before you dive in, you’re going to need to &lt;a href=&quot;https://realpython.com/python-import/&quot;&gt;import&lt;/a&gt; the module you’ll use to simulate the computer’s choices:&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;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;random&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Awesome! Now you’re able to use the different tools inside &lt;code&gt;random&lt;/code&gt; to randomize the computer’s actions in the game. Now what? Since your users will also need to be able to choose their actions, the first logical thing you need is a way to take in user input.&lt;/p&gt;
&lt;h3 id=&quot;take-user-input&quot;&gt;Take User Input&lt;a class=&quot;headerlink&quot; href=&quot;#take-user-input&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://realpython.com/python-input-output/&quot;&gt;Taking input from a user&lt;/a&gt; is pretty straightforward in Python. The goal here is to ask the user what they would like to choose as an action and then assign that choice to a variable:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;user_action&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Enter a choice (rock, paper, scissors): &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will prompt the user to enter a selection and save it to a variable for later use. Now that the user has selected an action, the computer needs to decide what to do.&lt;/p&gt;
&lt;h3 id=&quot;make-the-computer-choose&quot;&gt;Make the Computer Choose&lt;a class=&quot;headerlink&quot; href=&quot;#make-the-computer-choose&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A competitive game of rock paper scissors involves &lt;a href=&quot;https://arstechnica.com/science/2014/05/win-at-rock-paper-scissors-by-knowing-thy-opponent/&quot;&gt;strategy&lt;/a&gt;. Rather than trying to develop a model for that, though, you can save yourself some time by having the computer select a random action. &lt;a href=&quot;https://realpython.com/python-random/&quot;&gt;Random selections&lt;/a&gt; are a great way to have the computer choose a &lt;a href=&quot;https://en.wikipedia.org/wiki/Pseudorandom_number_generator&quot;&gt;pseudorandom&lt;/a&gt; value.&lt;/p&gt;
&lt;p&gt;You can use &lt;strong&gt;&lt;code&gt;random.choice()&lt;/code&gt;&lt;/strong&gt; to have the computer randomly select between the actions:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;possible_actions&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;rock&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;paper&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;scissors&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;computer_action&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;choice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;possible_actions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This allows a random element to be selected from the list. You can also &lt;a href=&quot;https://realpython.com/python-print/&quot;&gt;print&lt;/a&gt; the choices that the user and the computer made:&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;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;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;You chose &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user_action&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, computer chose &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;computer_action&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Printing the user and computer actions can be helpful to the user, and it can also help you debug later on in case something isn’t quite right with the outcome.&lt;/p&gt;
&lt;h3 id=&quot;determine-a-winner&quot;&gt;Determine a Winner&lt;a class=&quot;headerlink&quot; href=&quot;#determine-a-winner&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-rock-paper-scissors/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-rock-paper-scissors/ »&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 #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>Sentiment Analysis: First Steps With Python&#x27;s NLTK Library</title>
      <id>https://realpython.com/python-nltk-sentiment-analysis/</id>
      <link href="https://realpython.com/python-nltk-sentiment-analysis/"/>
      <updated>2021-01-13T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to work with Python&#x27;s Natural Language Toolkit (NLTK) to process and analyze text. You&#x27;ll also learn how to perform sentiment analysis with built-in as well as custom classifiers!</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Once you understand the &lt;a href=&quot;https://realpython.com/learning-paths/python-basics-book/&quot;&gt;basics of Python&lt;/a&gt;, familiarizing yourself with its most popular packages will not only boost your mastery over the language but also rapidly increase your versatility. In this tutorial, you’ll learn the amazing capabilities of the Natural Language Toolkit (NLTK) for processing and analyzing text, from basic &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;functions&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/sentiment-analysis-python/&quot;&gt;sentiment analysis&lt;/a&gt; powered by &lt;a href=&quot;https://realpython.com/learning-paths/machine-learning-python/&quot;&gt;machine learning&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sentiment analysis&lt;/strong&gt; can help you determine the ratio of positive to negative engagements about a specific topic. You can analyze bodies of text, such as comments, tweets, and product reviews, to obtain insights from your audience. In this tutorial, you’ll learn the important features of NLTK for processing text data and the different approaches you can use to perform sentiment analysis on your data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll be ready to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Split&lt;/strong&gt; and &lt;strong&gt;filter&lt;/strong&gt; text data in preparation for analysis&lt;/li&gt;
&lt;li&gt;Analyze &lt;strong&gt;word frequency&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;Find &lt;strong&gt;concordance&lt;/strong&gt; and &lt;strong&gt;collocations&lt;/strong&gt; using different methods&lt;/li&gt;
&lt;li&gt;Perform quick &lt;strong&gt;sentiment analysis&lt;/strong&gt; with NLTK’s built-in classifier&lt;/li&gt;
&lt;li&gt;Define features for &lt;strong&gt;custom classification&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use and compare &lt;strong&gt;classifiers&lt;/strong&gt; for sentiment analysis with NLTK&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-experiment&quot; data-focus=&quot;false&quot;&gt;Click here to get our free Python Cheat Sheet&lt;/a&gt; that shows you the basics of Python 3, like working with data types, dictionaries, lists, and Python functions.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;getting-started-with-nltk&quot;&gt;Getting Started With NLTK&lt;a class=&quot;headerlink&quot; href=&quot;#getting-started-with-nltk&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The NLTK library contains various utilities that allow you to effectively manipulate and analyze linguistic data. Among its advanced features are &lt;strong&gt;text classifiers&lt;/strong&gt; that you can use for many kinds of classification, including sentiment analysis.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sentiment analysis&lt;/strong&gt; is the practice of using algorithms to classify various samples of related text into overall positive and negative categories. With NLTK, you can employ these algorithms through powerful built-in machine learning operations to obtain insights from linguistic data.&lt;/p&gt;
&lt;h3 id=&quot;installing-and-importing&quot;&gt;Installing and Importing&lt;a class=&quot;headerlink&quot; href=&quot;#installing-and-importing&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You’ll begin by installing some prerequisites, including NLTK itself as well as specific resources you’ll need throughout this tutorial.&lt;/p&gt;
&lt;p&gt;First, use &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt; to install NLTK:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python3 -m pip install nltk
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;While this will install the NLTK module, you’ll still need to obtain a few additional resources. Some of them are text samples, and others are data models that certain NLTK functions require.&lt;/p&gt;
&lt;p&gt;To get the resources you’ll need, use &lt;code&gt;nltk.download()&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;nltk&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;nltk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;download&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;NLTK will display a download manager showing all available and installed resources. Here are the ones you’ll need to download for this tutorial:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;names&lt;/code&gt;:&lt;/strong&gt; A &lt;a href=&quot;http://www-2.cs.cmu.edu/afs/cs/project/ai-repository/ai/areas/nlp/corpora/names/&quot;&gt;list of common English names&lt;/a&gt; compiled by Mark Kantrowitz&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;stopwords&lt;/code&gt;:&lt;/strong&gt; A list of really common words, like articles, pronouns, prepositions, and conjunctions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;state_union&lt;/code&gt;:&lt;/strong&gt; A sample of transcribed &lt;a href=&quot;https://en.wikipedia.org/wiki/State_of_the_Union&quot;&gt;State of the Union&lt;/a&gt; addresses by different US presidents, compiled by Kathleen Ahrens &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;twitter_samples&lt;/code&gt;:&lt;/strong&gt; A list of social media phrases posted to Twitter&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;movie_reviews&lt;/code&gt;:&lt;/strong&gt; &lt;a href=&quot;http://www.cs.cornell.edu/people/pabo/movie-review-data/&quot;&gt;Two thousand movie reviews&lt;/a&gt; categorized by Bo Pang and Lillian Lee&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;averaged_perceptron_tagger&lt;/code&gt;:&lt;/strong&gt; A data model that NLTK uses to categorize words into their &lt;a href=&quot;https://en.wikipedia.org/wiki/Part_of_speech&quot;&gt;part of speech&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;vader_lexicon&lt;/code&gt;:&lt;/strong&gt; A scored &lt;a href=&quot;https://github.com/cjhutto/vaderSentiment&quot;&gt;list of words and jargon&lt;/a&gt; that NLTK references when performing sentiment analysis, created by C.J. Hutto and Eric Gilbert&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;punkt&lt;/code&gt;:&lt;/strong&gt; A data model created by Jan Strunk that NLTK uses to split full texts into word lists&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Throughout this tutorial, you’ll find many references to the word &lt;strong&gt;corpus&lt;/strong&gt; and its plural form, &lt;strong&gt;corpora&lt;/strong&gt;. A corpus is a large collection of related text samples. In the context of NLTK, corpora are compiled with features for &lt;a href=&quot;https://en.wikipedia.org/wiki/Natural_language_processing&quot;&gt;natural language processing (NLP)&lt;/a&gt;, such as categories and numerical scores for particular features.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;A quick way to download specific resources directly from the console is to pass a list to &lt;code&gt;nltk.download()&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;nltk&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;nltk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;download&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;names&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;stopwords&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;state_union&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;twitter_samples&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;movie_reviews&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;averaged_perceptron_tagger&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;vader_lexicon&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;punkt&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;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data] Downloading package names to /home/user/nltk_data...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]   Unzipping corpora/names.zip.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data] Downloading package stopwords to /home/user/nltk_data...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]   Unzipping corpora/stopwords.zip.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data] Downloading package state_union to&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]     /home/user/nltk_data...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]   Unzipping corpora/state_union.zip.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data] Downloading package twitter_samples to&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]     /home/user/nltk_data...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]   Unzipping corpora/twitter_samples.zip.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data] Downloading package movie_reviews to&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]     /home/user/nltk_data...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]   Unzipping corpora/movie_reviews.zip.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data] Downloading package averaged_perceptron_tagger to&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]     /home/user/nltk_data...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]   Unzipping taggers/averaged_perceptron_tagger.zip.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data] Downloading package vader_lexicon to&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]     /home/user/nltk_data...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data] Downloading package punkt to /home/user/nltk_data...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;[nltk_data]   Unzipping tokenizers/punkt.zip.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will tell NLTK to find and download each resource based on its identifier.&lt;/p&gt;
&lt;p&gt;Should NLTK require additional resources that you haven’t installed, you’ll see a helpful &lt;code&gt;LookupError&lt;/code&gt; with details and instructions to download the resource:&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;nltk&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;w&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nltk&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;corpus&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;shakespeare&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;words&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;go&quot;&gt;LookupError:&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;**********************************************************************&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Resource shakespeare not found.&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  Please use the NLTK Downloader to obtain the resource:&lt;/span&gt;

&lt;span class=&quot;go&quot;&gt;  &amp;gt;&amp;gt;&amp;gt; import nltk&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  &amp;gt;&amp;gt;&amp;gt; nltk.download(&#x27;shakespeare&#x27;)&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;LookupError&lt;/code&gt; specifies which resource is necessary for the requested operation along with instructions to download it using its identifier.&lt;/p&gt;
&lt;h3 id=&quot;compiling-data&quot;&gt;Compiling Data&lt;a class=&quot;headerlink&quot; href=&quot;#compiling-data&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-nltk-sentiment-analysis/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-nltk-sentiment-analysis/ »&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>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>NumPy Tutorial: Your First Steps Into Data Science in Python</title>
      <id>https://realpython.com/numpy-tutorial/</id>
      <link href="https://realpython.com/numpy-tutorial/"/>
      <updated>2021-01-11T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn everything you need to know to get up and running with NumPy, Python&#x27;s de facto standard for multidimensional data arrays. NumPy is the foundation for most data science in Python, so if you&#x27;re interested in that field, then this is a great place to start.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;NumPy is a Python library that provides a simple yet powerful data structure: the &lt;strong&gt;n-dimensional array&lt;/strong&gt;. This is the foundation on which almost all the power of Python’s data science toolkit is built, and learning NumPy is the first step on any Python data scientist’s journey. This tutorial will provide you with the knowledge you need to use NumPy and the higher-level libraries that rely on it.&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;core concepts&lt;/strong&gt; in data science are made possible by NumPy&lt;/li&gt;
&lt;li&gt;How to create &lt;strong&gt;NumPy arrays&lt;/strong&gt; using various methods&lt;/li&gt;
&lt;li&gt;How to manipulate NumPy arrays to perform &lt;strong&gt;useful calculations&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to apply these new skills to &lt;strong&gt;real-world problems&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this NumPy tutorial, you should be familiar with writing Python code. Working through the &lt;a href=&quot;https://realpython.com/learning-paths/python3-introduction/&quot;&gt;Introduction to Python&lt;/a&gt; learning path is a great way to make sure you’ve got the basic skills covered. If you’re familiar with &lt;a href=&quot;https://en.wikipedia.org/wiki/Matrix_(mathematics)&quot;&gt;matrix mathematics&lt;/a&gt;, then that will certainly be helpful as well. You don’t need to know anything about data science, however. You’ll learn that here.&lt;/p&gt;
&lt;p&gt;There’s also a repository of NumPy code samples that you’ll see throughout this tutorial. You can use it for reference and experiment with the examples to see how changing the code changes the outcome. To download the code, 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 Sample Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/numpy-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-numpy-python-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to get the sample code you’ll use&lt;/a&gt; to learn about NumPy in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;choosing-numpy-the-benefits&quot;&gt;Choosing NumPy: The Benefits&lt;a class=&quot;headerlink&quot; href=&quot;#choosing-numpy-the-benefits&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Since you already know Python, you may be asking yourself if you really have to learn a whole new paradigm to do data science. Python’s &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;&lt;code&gt;for&lt;/code&gt; loops&lt;/a&gt; are awesome! &lt;a href=&quot;https://realpython.com/python-csv/&quot;&gt;Reading and writing CSV files&lt;/a&gt; can be done with traditional code. However, there are some convincing arguments for learning a new paradigm.&lt;/p&gt;
&lt;p&gt;Here are the top four benefits that NumPy can bring to your code:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;More speed:&lt;/strong&gt; NumPy uses algorithms written in C that complete in nanoseconds rather than seconds.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fewer loops:&lt;/strong&gt; NumPy helps you to &lt;a href=&quot;https://realpython.com/numpy-array-programming/&quot;&gt;reduce loops&lt;/a&gt; and keep from getting tangled up in iteration indices.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clearer code:&lt;/strong&gt; Without loops, your code will look more like the equations you’re trying to calculate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Better quality:&lt;/strong&gt; There are thousands of contributors working to keep NumPy fast, friendly, and bug free.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Because of these benefits, NumPy is the de facto standard for multidimensional arrays in Python data science, and many of the most popular libraries are built on top of it. Learning NumPy is a great way to set down a solid foundation as you expand your knowledge into more specific areas of data science.&lt;/p&gt;
&lt;h2 id=&quot;installing-numpy&quot;&gt;Installing NumPy&lt;a class=&quot;headerlink&quot; href=&quot;#installing-numpy&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It’s time to get everything set up so you can start learning how to work with NumPy. There are a few different ways to do this, and you can’t go wrong by following the instructions on the &lt;a href=&quot;https://numpy.org/install/&quot;&gt;NumPy website&lt;/a&gt;. But there are some extra details to be aware of that are outlined below. &lt;/p&gt;
&lt;p&gt;You’ll also be installing &lt;a href=&quot;https://realpython.com/python-matplotlib-guide/&quot;&gt;Matplotlib&lt;/a&gt;. You’ll use it in one of the later examples to explore how other libraries make use of NumPy.&lt;/p&gt;
&lt;h3 id=&quot;using-replit-as-an-online-editor&quot;&gt;Using Repl.it as an Online Editor&lt;a class=&quot;headerlink&quot; href=&quot;#using-replit-as-an-online-editor&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;If you just want to get started with some examples, follow along with this tutorial, and start building some muscle memory with NumPy, then &lt;a href=&quot;https://repl.it/&quot;&gt;Repl.it&lt;/a&gt; is a great option for in-browser editing. You can sign up and fire up a Python environment in minutes. Along the left side, there’s a tab for packages. You can add as many as you want. For this NumPy tutorial, go with the current versions of NumPy and Matplotlib.&lt;/p&gt;
&lt;p&gt;Here’s where you can find the packages in the interface:&lt;/p&gt;
&lt;figure&gt;&lt;a href=&quot;https://files.realpython.com/media/numpy-tutorial-replit-1000.070229bde757.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-50&quot; src=&quot;https://files.realpython.com/media/numpy-tutorial-replit-1000.070229bde757.png&quot; width=&quot;1449&quot; height=&quot;1000&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/numpy-tutorial-replit-1000.070229bde757.png&amp;amp;w=362&amp;amp;sig=a086162dbbe3336f94bab1bb6b9d747fd1cbcd1f 362w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/numpy-tutorial-replit-1000.070229bde757.png&amp;amp;w=724&amp;amp;sig=a7827a5e9ba2c0bcb2aa216bb1fd388cc75f52a4 724w, https://files.realpython.com/media/numpy-tutorial-replit-1000.070229bde757.png 1449w&quot; sizes=&quot;75vw&quot; alt=&#x27;The location of the &quot;Packages&quot; tab on Repl.it.&#x27; data-asset=&quot;2937&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Luckily, they allow you to just click and install.&lt;/p&gt;
&lt;h3 id=&quot;installing-numpy-with-anaconda&quot;&gt;Installing NumPy With Anaconda&lt;a class=&quot;headerlink&quot; href=&quot;#installing-numpy-with-anaconda&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.anaconda.com/products/individual&quot;&gt;Anaconda&lt;/a&gt; distribution is a suite of common Python data science tools bundled around a &lt;strong&gt;package manager&lt;/strong&gt; that helps manage your &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environments&lt;/a&gt; and project dependencies. It’s built around &lt;a href=&quot;https://docs.conda.io/en/latest/&quot;&gt;&lt;code&gt;conda&lt;/code&gt;&lt;/a&gt;, which is the actual package manager. This is the method recommended by the NumPy project, especially if you’re stepping into data science in Python without having already &lt;a href=&quot;https://realpython.com/python-windows-machine-learning-setup/&quot;&gt;set up a complex development environment&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you’ve already got a workflow you like that uses &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/pipenv-guide/&quot;&gt;Pipenv&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/effective-python-environment/#poetry&quot;&gt;Poetry&lt;/a&gt;, or some other toolset, then it might be better not to add &lt;code&gt;conda&lt;/code&gt; to the mix. The &lt;code&gt;conda&lt;/code&gt; package repository is separate from &lt;a href=&quot;https://pypi.org/&quot;&gt;PyPI&lt;/a&gt;, and &lt;code&gt;conda&lt;/code&gt; itself sets up a separate little island of packages on your machine, so managing paths and remembering which package lives where can be a &lt;a href=&quot;https://xkcd.com/1987/&quot;&gt;nightmare&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Once you’ve got &lt;code&gt;conda&lt;/code&gt; installed, you can run the &lt;code&gt;install&lt;/code&gt; command for the libraries you’ll need:&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;conda install numpy matplotlib
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will install what you need for this NumPy tutorial, and you’ll be all set to go.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/numpy-tutorial/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/numpy-tutorial/ »&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 #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>Django Admin Customization</title>
      <id>https://realpython.com/courses/django-admin-customization/</id>
      <link href="https://realpython.com/courses/django-admin-customization/"/>
      <updated>2020-12-29T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to customize Django&#x27;s admin with Python. You&#x27;ll use AdminModel objects to add display columns, calculate values, link to referring objects, and search and filter results. You&#x27;ll also use template overriding to gain full control over the admin&#x27;s HTML.</summary>
      <content type="html">
        &lt;p&gt;The &lt;a href=&quot;https://www.djangoproject.com/&quot;&gt;&lt;strong&gt;Django&lt;/strong&gt;&lt;/a&gt; framework comes with a powerful &lt;a href=&quot;https://docs.djangoproject.com/en/3.0/ref/contrib/admin/&quot;&gt;administrative tool&lt;/a&gt; called &lt;strong&gt;admin&lt;/strong&gt;. You can use it out of the box to quickly add, delete, or edit any database model from a web interface. But with a little extra code, you can customize the Django admin to take your admin capabilities to the next level.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add &lt;strong&gt;attribute columns&lt;/strong&gt; in the model object list &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link&lt;/strong&gt; between model objects&lt;/li&gt;
&lt;li&gt;Add &lt;strong&gt;filters&lt;/strong&gt; to the model object list&lt;/li&gt;
&lt;li&gt;Make model object lists &lt;strong&gt;searchable&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Modify the object &lt;strong&gt;edit forms&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Override Django &lt;strong&gt;admin templates&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 #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>
  
    <entry>
      <title>Serializing Objects With the Python pickle Module</title>
      <id>https://realpython.com/courses/pickle-serializing-objects/</id>
      <link href="https://realpython.com/courses/pickle-serializing-objects/"/>
      <updated>2020-12-22T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how you can use the Python pickle module to convert your objects into a stream of bytes that can be saved to a disk or sent over a network. You&#x27;ll also learn the security implications of using this process on objects from an untrusted source.</summary>
      <content type="html">
        &lt;p&gt;As a developer, you may sometimes need to send complex object hierarchies over a network or save the internal state of your objects to a disk or database for later use. To accomplish this, you can use a process called &lt;strong&gt;serialization&lt;/strong&gt;, which is fully supported by the standard library thanks to the Python &lt;strong&gt;&lt;code&gt;pickle&lt;/code&gt;&lt;/strong&gt; module.&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 it means to &lt;strong&gt;serialize&lt;/strong&gt; and &lt;strong&gt;deserialize&lt;/strong&gt; an object&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;modules&lt;/strong&gt; you can use to serialize objects in Python&lt;/li&gt;
&lt;li&gt;Which kinds of objects can be serialized with the Python &lt;strong&gt;&lt;code&gt;pickle&lt;/code&gt;&lt;/strong&gt; module&lt;/li&gt;
&lt;li&gt;How to use the Python &lt;code&gt;pickle&lt;/code&gt; module to serialize &lt;strong&gt;object hierarchies&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What the &lt;strong&gt;risks&lt;/strong&gt; are when deserializing an object from an untrusted source&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 #40: How Python Manages Memory and Creating Arrays With np.linspace</title>
      <id>https://realpython.com/podcasts/rpp/40/</id>
      <link href="https://realpython.com/podcasts/rpp/40/"/>
      <updated>2020-12-18T12:00:00+00:00</updated>
      <summary>Have you wondered how Python manages memory? How are your variables stored in memory, and when do they get deleted? This week on the show, David Amos is here, and he has brought another batch of PyCoder&#x27;s Weekly articles and projects.

Along with the Real Python article on Python memory management, we also talk about another article about creating even and non-even spaced arrays in Python with np.linspace.</summary>
      <content type="html">
        &lt;p&gt;Have you wondered how Python manages memory? How are your variables stored in memory, and when do they get deleted? This week on the show, David Amos is here, and he has brought another batch of PyCoder&#x27;s Weekly articles and projects.

Along with the Real Python article on Python memory management, we also talk about another article about creating even and non-even spaced arrays in Python with np.linspace.&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 Turtle for Beginners</title>
      <id>https://realpython.com/courses/python-turtle-beginners/</id>
      <link href="https://realpython.com/courses/python-turtle-beginners/"/>
      <updated>2020-12-15T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn the basics of Python programming with the help of a simple and interactive Python library called turtle. If you&#x27;re a beginner to Python, then this course will definitely help you on your journey as you take your first steps into the world of programming.</summary>
      <content type="html">
        &lt;p&gt;In this step-by-step course, you&amp;rsquo;ll learn the basics of Python programming with the help of a simple and interactive Python library called turtle. If you&amp;rsquo;re a beginner to Python, then this course will definitely help you on your journey as you take your first steps into the world of programming. The Python &lt;code&gt;turtle&lt;/code&gt; library comes with a similar interactive feature that gives new programmers a taste of what it&amp;rsquo;s like to work with Python.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you will:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Understand&lt;/strong&gt; what the Python &lt;code&gt;turtle&lt;/code&gt; library is&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Learn&lt;/strong&gt; how to set &lt;code&gt;turtle&lt;/code&gt; up on your computer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Program&lt;/strong&gt; with the Python &lt;code&gt;turtle&lt;/code&gt; library&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grasp&lt;/strong&gt; some important Python concepts and &lt;code&gt;turtle&lt;/code&gt; commands&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Develop&lt;/strong&gt; a short but entertaining game using what you&amp;rsquo;ve learned&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 #39: Generators, Coroutines, and Learning Python Through Exercises</title>
      <id>https://realpython.com/podcasts/rpp/39/</id>
      <link href="https://realpython.com/podcasts/rpp/39/"/>
      <updated>2020-12-11T12:00:00+00:00</updated>
      <summary>Have you started to use generators in Python? Are you unsure why you would even use one over a regular function? How do you use the special &quot;send&quot; method and the &quot;yield from&quot; syntax? This week on the show, we have Reuven Lerner to talk about his PyCon Africa 2020 talk titled &quot;Generators, coroutines, and nanoservices.&quot;</summary>
      <content type="html">
        &lt;p&gt;Have you started to use generators in Python? Are you unsure why you would even use one over a regular function? How do you use the special &quot;send&quot; method and the &quot;yield from&quot; syntax? This week on the show, we have Reuven Lerner to talk about his PyCon Africa 2020 talk titled &quot;Generators, coroutines, and nanoservices.&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>Speed Up Python With Concurrency</title>
      <id>https://realpython.com/courses/speed-python-concurrency/</id>
      <link href="https://realpython.com/courses/speed-python-concurrency/"/>
      <updated>2020-12-08T14:00:00+00:00</updated>
      <summary>Learn what concurrency means in Python and why you might want to use it. You&#x27;ll see a simple, non-concurrent approach and then look into why you&#x27;d want threading, asyncio, or multiprocessing.</summary>
      <content type="html">
        &lt;p&gt;Concurrency is the act of having your computer do multiple things at the same time. If you&amp;rsquo;ve heard lots of talk about &lt;code&gt;asyncio&lt;/code&gt; &lt;a href=&quot;https://realpython.com/python37-new-features/&quot;&gt;being added to Python&lt;/a&gt; but are curious how it compares to other concurrency methods or are wondering what concurrency is and how it might speed up your program, you&amp;rsquo;ve come to the right place.&lt;/p&gt;
&lt;p&gt;In this course, you&amp;rsquo;ll learn the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How I/O bound programs are effected by latency&lt;/li&gt;
&lt;li&gt;Which concurrent programming patterns to use&lt;/li&gt;
&lt;li&gt;What the differences are between the Python concurrency libraries&lt;/li&gt;
&lt;li&gt;How to write code that uses the &lt;code&gt;threading&lt;/code&gt;, &lt;code&gt;asyncio&lt;/code&gt;, and &lt;code&gt;multiprocessing&lt;/code&gt; libraries&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sample code was tested using Python 3.8.5. Much of the &lt;code&gt;asyncio&lt;/code&gt; library has been in flux since Python 3.4, it is recommended to use at least Python 3.7 for the &lt;code&gt;asyncio&lt;/code&gt; portions of the course.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #38: Looping With enumerate() and Python GUIs With PyQt</title>
      <id>https://realpython.com/podcasts/rpp/38/</id>
      <link href="https://realpython.com/podcasts/rpp/38/"/>
      <updated>2020-12-04T12:00:00+00:00</updated>
      <summary>If you&#x27;re coming to Python from a different language, you may not know about a useful tool for working with loops, Python&#x27;s built-in enumerate function. This week on the show, David Amos is here, and he has brought another batch of PyCoder&#x27;s Weekly articles and projects.

Along with the Real Python article covering the details of the enumerate function, we also talk about another article about constructing Python graphical user interface elements in PyQt.</summary>
      <content type="html">
        &lt;p&gt;If you&#x27;re coming to Python from a different language, you may not know about a useful tool for working with loops, Python&#x27;s built-in enumerate function. This week on the show, David Amos is here, and he has brought another batch of PyCoder&#x27;s Weekly articles and projects.

Along with the Real Python article covering the details of the enumerate function, we also talk about another article about constructing Python graphical user interface elements in PyQt.&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 #37: Teaching Python and Finding Resources for Students</title>
      <id>https://realpython.com/podcasts/rpp/37/</id>
      <link href="https://realpython.com/podcasts/rpp/37/"/>
      <updated>2020-11-27T12:00:00+00:00</updated>
      <summary>One of the best ways to learn something well is to teach it. This week on the show, we have Kelly Schuster-Paredes and Sean Tibor from the Teaching Python podcast.

Sean and Kelly teach middle school students Python and share their art and science of teaching Python on their podcast. They wanted to come on the show to talk about the Real Python articles, quizzes, and other resources they use when teaching their students.</summary>
      <content type="html">
        &lt;p&gt;One of the best ways to learn something well is to teach it. This week on the show, we have Kelly Schuster-Paredes and Sean Tibor from the Teaching Python podcast.

Sean and Kelly teach middle school students Python and share their art and science of teaching Python on their podcast. They wanted to come on the show to talk about the Real Python articles, quizzes, and other resources they use when teaching their students.&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>
