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

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

  
    <entry>
      <title>Get Started With Django Part 2: Django User Management</title>
      <id>https://realpython.com/django-user-management/</id>
      <link href="https://realpython.com/django-user-management/"/>
      <updated>2020-07-01T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn how to extend your Django application with a user management system, complete with email sending and third-party authentication.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you finished the &lt;a href=&quot;https://realpython.com/get-started-with-django-1/&quot;&gt;first part&lt;/a&gt; of this series, then you may already have a lot of ideas for your own Django applications. At some point, you might decide to extend them with user accounts. In this step-by-step tutorial, you’ll learn how to work with Django user management and add it to your program.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create an application where users can &lt;strong&gt;register&lt;/strong&gt;, &lt;strong&gt;log in&lt;/strong&gt;, and &lt;strong&gt;reset&lt;/strong&gt; and &lt;strong&gt;change passwords&lt;/strong&gt; on their own&lt;/li&gt;
&lt;li&gt;Edit the default &lt;strong&gt;Django templates&lt;/strong&gt; responsible for &lt;strong&gt;user management&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Send password reset emails&lt;/strong&gt; to actual email addresses&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authenticate&lt;/strong&gt; using an &lt;strong&gt;external service&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let’s get started!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;#&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-django-resources-learing-guide&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a free Django Learning Resources Guide (PDF)&lt;/a&gt; that shows you tips and tricks as well as common pitfalls to avoid when building Python + Django web applications.&lt;/p&gt;&lt;/div&gt;

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

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

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

&lt;p&gt;In this example, your application is called &lt;code&gt;users&lt;/code&gt;. Keep in mind that you need to install it by adding it to &lt;code&gt;INSTALLED_APPS&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# awesome_website/settings.py&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;INSTALLED_APPS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
&lt;span class=&quot;hll&quot;&gt;    &lt;span class=&quot;s2&quot;&gt;&quot;users&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.admin&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.auth&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.contenttypes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.sessions&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.messages&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;django.contrib.staticfiles&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Next, apply the migrations and run the server:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python manage.py migrate
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python manage.py runserver
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

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

&lt;span class=&quot;n&quot;&gt;AUTH_PASSWORD_VALIDATORS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# {&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#     &quot;NAME&quot;: &quot;django.contrib.auth.password_validation.UserAttributeSimilarityValidator&quot;,&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# },&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# {&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#     &quot;NAME&quot;: &quot;django.contrib.auth.password_validation.MinimumLengthValidator&quot;,&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# },&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# {&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#     &quot;NAME&quot;: &quot;django.contrib.auth.password_validation.CommonPasswordValidator&quot;,&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# },&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# {&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;#     &quot;NAME&quot;: &quot;django.contrib.auth.password_validation.NumericPasswordValidator&quot;,&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# },&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

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

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

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

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

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

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

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

&lt;span class=&quot;n&quot;&gt;sg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[[]],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;margins&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

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

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

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

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

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

&lt;p&gt;Next, as indicated in the output above, you can use &lt;code&gt;help()&lt;/code&gt; again by passing in the specific keyword that you need more information about. You can do this, for example, with the &lt;code&gt;pass&lt;/code&gt; keyword:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;pass&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;The &quot;pass&quot; statement&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;********************&lt;/span&gt;

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

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

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

&lt;span class=&quot;go&quot;&gt;   class C: pass       # a class with no methods (yet)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-keywords/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-keywords/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #13: PDFs in Python and Projects on the Raspberry Pi</title>
      <id>https://realpython.com/podcasts/rpp/13/</id>
      <link href="https://realpython.com/podcasts/rpp/13/"/>
      <updated>2020-06-12T12:00:00+00:00</updated>
      <summary>Have you wanted to work with PDF files in Python? Maybe you want to extract text, merge and concatenate files, or even create PDFs from scratch. Are you interested in building hardware projects using a Raspberry Pi? This week on the show we have David Amos from the Real Python team to discuss his recent article on working with PDFs. David also brings a few other articles from the wider Python community for us to discuss.</summary>
      <content type="html">
        &lt;p&gt;Have you wanted to work with PDF files in Python? Maybe you want to extract text, merge and concatenate files, or even create PDFs from scratch. Are you interested in building hardware projects using a Raspberry Pi? This week on the show we have David Amos from the Real Python team to discuss his recent article on working with PDFs. David also brings a few other articles from the wider Python community for us to discuss.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>SettingWithCopyWarning in Pandas: Views vs Copies</title>
      <id>https://realpython.com/pandas-settingwithcopywarning/</id>
      <link href="https://realpython.com/pandas-settingwithcopywarning/"/>
      <updated>2020-06-10T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn about views and copies in NumPy and Pandas. You&#x27;ll see why the SettingWithCopyWarning occurs in Pandas and how to properly write code that avoids it.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;a href=&quot;https://numpy.org/&quot;&gt;&lt;strong&gt;NumPy&lt;/strong&gt;&lt;/a&gt; and &lt;a href=&quot;https://pandas.pydata.org/&quot;&gt;&lt;strong&gt;Pandas&lt;/strong&gt;&lt;/a&gt; are very comprehensive, efficient, and flexible Python tools for data manipulation. An important concept for proficient users of these two libraries to understand is how data are referenced as &lt;strong&gt;shallow copies&lt;/strong&gt; (&lt;strong&gt;views&lt;/strong&gt;) and &lt;strong&gt;deep copies&lt;/strong&gt; (or just &lt;strong&gt;copies&lt;/strong&gt;). Pandas sometimes issues a &lt;code&gt;SettingWithCopyWarning&lt;/code&gt; to warn the user of a potentially inappropriate use of views and copies.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this article, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;views&lt;/strong&gt; and &lt;strong&gt;copies&lt;/strong&gt; are in NumPy and Pandas&lt;/li&gt;
&lt;li&gt;How to properly work with views and copies in NumPy and Pandas&lt;/li&gt;
&lt;li&gt;Why the &lt;code&gt;SettingWithCopyWarning&lt;/code&gt; happens in Pandas&lt;/li&gt;
&lt;li&gt;How to avoid getting a &lt;code&gt;SettingWithCopyWarning&lt;/code&gt; in Pandas&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You’ll first see a short explanation of what the &lt;code&gt;SettingWithCopyWarning&lt;/code&gt; is and how to avoid it. You might find this enough for your needs, but you can also dig a bit deeper into the details of NumPy and Pandas to learn more about copies and views.&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-numpy-learning-guide&quot; data-focus=&quot;false&quot;&gt;Click here to get access to a free NumPy Resources Guide&lt;/a&gt; that points you to the best tutorials, videos, and books for improving your NumPy skills.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;To follow the examples in this article, you’ll need &lt;a href=&quot;https://docs.python.org/3.7/&quot;&gt;Python 3.7&lt;/a&gt; or &lt;a href=&quot;https://docs.python.org/3.8/&quot;&gt;3.8&lt;/a&gt;, as well as the libraries &lt;a href=&quot;https://realpython.com/search?q=numpy&quot;&gt;NumPy&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/search?q=pandas&quot;&gt;Pandas&lt;/a&gt;. This article is written for NumPy version 1.18.1 and Pandas version 1.0.3. You can &lt;a href=&quot;https://packaging.python.org/tutorials/installing-packages/&quot;&gt;install them with &lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; python -m pip install -U &lt;span class=&quot;s2&quot;&gt;&quot;numpy==1.18.*&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;pandas==1.0.*&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you prefer &lt;a href=&quot;https://www.anaconda.com/&quot;&gt;Anaconda&lt;/a&gt; or &lt;a href=&quot;https://docs.conda.io/en/latest/miniconda.html&quot;&gt;Miniconda&lt;/a&gt; distributions, you can use the &lt;a href=&quot;https://docs.conda.io/en/latest/&quot;&gt;conda&lt;/a&gt; package management system. To learn more about this approach, check out &lt;a href=&quot;https://realpython.com/python-windows-machine-learning-setup/&quot;&gt;Setting Up Python for Machine Learning on Windows&lt;/a&gt;. For now, it’ll be enough to install NumPy and Pandas in your &lt;a href=&quot;https://realpython.com/python-windows-machine-learning-setup/#understanding-conda-environments&quot;&gt;environment&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight sh&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$&lt;/span&gt; conda install &lt;span class=&quot;nv&quot;&gt;numpy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;.18.* &lt;span class=&quot;nv&quot;&gt;pandas&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;.0.*
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now that you have NumPy and Pandas installed, you can import them and check their versions:&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;numpy&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;np&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pandas&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;pd&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;__version__&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;1.18.1&#x27;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;__version__&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&#x27;1.0.3&#x27;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That’s it. You have all the prerequisites for this article. Your versions might vary slightly, but the information below will still apply.&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 article requires you to have some prior Pandas knowledge. You’ll also need some knowledge of NumPy for the later sections.&lt;/p&gt;
&lt;p&gt;To refresh your NumPy skills, you can check out the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://numpy.org/doc/stable/user/quickstart.html&quot;&gt;NumPy Quickstart Tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/numpy-array-programming/&quot;&gt;Look Ma, No For-Loops: Array Programming With NumPy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/lessons/numpy-review-optional/&quot;&gt;Python Plotting With Matplotlib&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To remind yourself about Pandas, you can read the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/getting_started/10min.html&quot;&gt;10 minutes to pandas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/courses/pandas-dataframes-101/&quot;&gt;Pandas DataFrames 101&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/pandas-dataframe/&quot;&gt;The Pandas DataFrame: Make Working With Data Delightful&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/pandas-python-explore-dataset/&quot;&gt;Using Pandas and Python to Explore Your Dataset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://realpython.com/python-pandas-tricks/&quot;&gt;Python Pandas: Tricks &amp;amp; Features You May Not Know&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;Now you’re ready to start learning about views, copies, and the &lt;code&gt;SettingWithCopyWarning&lt;/code&gt;!&lt;/p&gt;
&lt;h2 id=&quot;example-of-a-settingwithcopywarning&quot;&gt;Example of a &lt;code&gt;SettingWithCopyWarning&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;If you work with Pandas, chances are that you’ve already seen a &lt;code&gt;SettingWithCopyWarning&lt;/code&gt; in action. It can be annoying and sometimes hard to understand. However, it’s issued for a reason.&lt;/p&gt;
&lt;p&gt;The first thing you should know about the &lt;code&gt;SettingWithCopyWarning&lt;/code&gt; is that it’s &lt;em&gt;not&lt;/em&gt; an &lt;a href=&quot;https://docs.python.org/3/tutorial/errors.html&quot;&gt;error&lt;/a&gt;. It’s a &lt;a href=&quot;https://docs.python.org/3/library/warnings.html&quot;&gt;warning&lt;/a&gt;. It warns you that you’ve probably done something that’s going to result in unwanted behavior in your code.&lt;/p&gt;
&lt;p&gt;Let’s see an example. You’ll start by &lt;a href=&quot;https://realpython.com/pandas-dataframe/#creating-a-pandas-dataframe&quot;&gt;creating a Pandas DataFrame&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&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;x&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arange&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&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;y&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arange&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&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;z&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;45&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;98&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])}&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&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;a&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;b&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;c&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;d&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;e&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;df&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DataFrame&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;df&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;    x   y   z&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;a   1   1  45&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;b   2   3  98&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;c   4   9  24&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;d   8  27  11&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;e  16  81  64&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This example creates a &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionary&lt;/a&gt; referenced by the &lt;a href=&quot;https://realpython.com/python-variables/&quot;&gt;variable&lt;/a&gt; &lt;code&gt;data&lt;/code&gt; that contains:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The keys &lt;code&gt;&quot;x&quot;&lt;/code&gt;, &lt;code&gt;&quot;y&quot;&lt;/code&gt;, and &lt;code&gt;&quot;z&quot;&lt;/code&gt;, which will be the column labels of the DataFrame&lt;/li&gt;
&lt;li&gt;Three &lt;a href=&quot;https://numpy.org/doc/stable/reference/arrays.ndarray.html&quot;&gt;NumPy arrays&lt;/a&gt; that hold the data of the DataFrame&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You create the first two arrays with the routine &lt;a href=&quot;https://numpy.org/doc/stable/reference/generated/numpy.arange.html&quot;&gt;&lt;code&gt;numpy.arange()&lt;/code&gt;&lt;/a&gt; and the last one with &lt;a href=&quot;https://numpy.org/doc/stable/reference/generated/numpy.array.html&quot;&gt;&lt;code&gt;numpy.array()&lt;/code&gt;&lt;/a&gt;. To learn more about &lt;code&gt;arange()&lt;/code&gt;, check out &lt;a href=&quot;https://realpython.com/how-to-use-numpy-arange/&quot;&gt;NumPy arange(): How to Use np.arange()&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;list&lt;/a&gt; attached to the variable &lt;code&gt;index&lt;/code&gt; contains the &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;strings&lt;/a&gt; &lt;code&gt;&quot;a&quot;&lt;/code&gt;, &lt;code&gt;&quot;b&quot;&lt;/code&gt;, &lt;code&gt;&quot;c&quot;&lt;/code&gt;, &lt;code&gt;&quot;d&quot;&lt;/code&gt;, and &lt;code&gt;&quot;e&quot;&lt;/code&gt;, which will be the row labels for the DataFrame.&lt;/p&gt;
&lt;p&gt;Finally, you initialize the &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html&quot;&gt;DataFrame&lt;/a&gt; &lt;code&gt;df&lt;/code&gt; that contains the information from &lt;code&gt;data&lt;/code&gt; and &lt;code&gt;index&lt;/code&gt;. You can visualize it like this:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/pandas-settingwithcopywarning/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/pandas-settingwithcopywarning/ »&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>Getting the Most Out of a Python Traceback</title>
      <id>https://realpython.com/courses/python-traceback/</id>
      <link href="https://realpython.com/courses/python-traceback/"/>
      <updated>2020-06-09T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn how to read and understand the information you can get from a Python stack traceback. You&#x27;ll walk through several examples and see some of the most common tracebacks in Python.</summary>
      <content type="html">
        &lt;p&gt;Python prints a &lt;strong&gt;traceback&lt;/strong&gt; when an &lt;strong&gt;exception&lt;/strong&gt; is raised in your code. The traceback output can be a bit overwhelming if you&amp;rsquo;re seeing it for the first time or you don&amp;rsquo;t know what it&amp;rsquo;s telling you. But the Python traceback has a wealth of information that can help you diagnose and fix the reason for the exception being raised in your code. Understanding what information a Python traceback provides is vital to becoming a better Python programmer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Make sense of the next traceback you see&lt;/li&gt;
&lt;li&gt;Recognize some of the more common tracebacks&lt;/li&gt;
&lt;li&gt;Log a traceback successfully while still handling the exception&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Community Interview With Kattni Rembor</title>
      <id>https://realpython.com/interview-kattni-rembor/</id>
      <link href="https://realpython.com/interview-kattni-rembor/"/>
      <updated>2020-06-08T14:00:00+00:00</updated>
      <summary>Kattni Rembor is a creative engineer at Adafruit Industries. In this interview, we talk about her work developing CircuitPython and the role mentorship has played in her career to date. She also shares her advice for anyone looking to start their first hardware project using CircuitPython.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;This week, I’m joined by &lt;a href=&quot;https://twitter.com/kattni&quot;&gt;Kattni Rembor&lt;/a&gt;, a creative engineer at &lt;a href=&quot;https://www.adafruit.com/&quot;&gt;Adafruit Industries&lt;/a&gt;. Kattni’s role is varied, as she covers embedded software, hardware design, technical writing, and community leadership. &lt;/p&gt;
&lt;p&gt;In this interview, we talk about her work developing &lt;a href=&quot;https://circuitpython.org/&quot;&gt;CircuitPython&lt;/a&gt; and the role mentorship has played in her career to date. She also shares her advice for anyone looking to start their first hardware project using CircuitPython.  &lt;/p&gt;
&lt;p class=&quot;mt-5&quot;&gt;&lt;strong&gt;Ricky:&lt;/strong&gt; &lt;em&gt;Welcome to Real Python, Kattni. I’m so happy that you could join me for this interview. Let’s start in the same manner we do with all our guests, with the inevitable question: How’d you get into programming, and when did you start using Python?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid w-50 float-right ml-3 rounded&quot; src=&quot;https://files.realpython.com/media/kattni-headshot.3d1dfdad013c.jpg&quot; width=&quot;1024&quot; height=&quot;681&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/kattni-headshot.3d1dfdad013c.jpg&amp;amp;w=256&amp;amp;sig=9fe54dd9491b4542b15ffeb3e8fe4e996be5b19e 256w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/kattni-headshot.3d1dfdad013c.jpg&amp;amp;w=512&amp;amp;sig=c1b5ef9b3467a6857b95e96f4e40a99e9c951614 512w, https://files.realpython.com/media/kattni-headshot.3d1dfdad013c.jpg 1024w&quot; sizes=&quot;75vw&quot; alt=&quot;Kattni Rembor&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kattni:&lt;/strong&gt; Those two questions are one and the same for me. I started with programming in July 2017, and I started with Python. I was unemployed and had a lot of time on my hands. &lt;/p&gt;
&lt;p&gt;I decided to try to learn Python. I looked around and figured the official tutorial was the best place to start. It turns out that it’s written for programmers, not beginners. I got to section four, hit a wall, and gave up.&lt;/p&gt;
&lt;p&gt;The hardware side of things began with a sale on Raspberry Pi Zero Ws and a friend of mine giving me one. I immediately did the thing you always do after getting a &lt;a href=&quot;https://www.raspberrypi.org/&quot;&gt;Raspberry Pi&lt;/a&gt;, and that is to buy all the things to go with your Raspberry Pi. &lt;/p&gt;
&lt;p&gt;I found an accessory called Sense HAT that had a bunch of sensors and LEDs built into it, but it wasn’t designed for the Raspberry Pi Zero W, so I tried to recreate it with individual sensors, which got expensive quickly. &lt;/p&gt;
&lt;p&gt;I discovered something called &lt;a href=&quot;https://www.adafruit.com/product/3333&quot;&gt;Circuit Playground Express&lt;/a&gt; that also had a lot of sensors and LEDs built into it and figured that would work. I ordered one, having no idea that it wasn’t compatible with the Raspberry Pi. It turns out it was a microcontroller. &lt;/p&gt;
&lt;p&gt;I got it home and took one look at it, decided it was entirely too complicated, and put it aside for two weeks before finally picking it up and plugging it in. I remember thinking, I will never write anything as cool as this demo. It was a rainbow swirl on the LEDs that played a tone for each LED that lit up. &lt;/p&gt;
&lt;p&gt;I looked into what I could do with the Circuit Playground Express. There were three options. Arduino went right over my head, and I had no desire whatsoever to try to learn it. MakeCode was just simple enough to be frustrating. I found a single mention of something called CircuitPython and thought, Hey, I’m trying to learn Python—this is perfect! &lt;/p&gt;
&lt;p&gt;I found an Adafruit video on getting started, got it installed, and within a very short period of time, I had a blinking LED. As simple as it sounds, nothing I had done with Python up to that point hooked me as much as that moment. For the first time since attempting to learn Python, I felt a connection to what I was doing. I had found my passion. &lt;/p&gt;
&lt;p class=&quot;mt-5&quot;&gt;&lt;strong&gt;Ricky:&lt;/strong&gt; &lt;em&gt;Adafruit’s microcontrollers are famously embedded with CircuitPython. For those who aren’t familiar with CircuitPython, how is this different from other microcontrollers? And how has this impacted the way you instruct in workshops and with &lt;a href=&quot;https://learn.adafruit.com/&quot;&gt;Adafruit’s Learn tutorials&lt;/a&gt;?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kattni:&lt;/strong&gt; The difference depends on which microcontrollers you’re referring to. &lt;a href=&quot;https://realpython.com/arduino-python/&quot;&gt;Arduino&lt;/a&gt; is basically C++, often uses an IDE, and requires being compiled before you can load it onto a board. MicroPython, while a version of Python, requires complicated extra steps to get going. &lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/interview-kattni-rembor/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/interview-kattni-rembor/ »&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 #12: Web Scraping in Python: Tools, Techniques, and Legality</title>
      <id>https://realpython.com/podcasts/rpp/12/</id>
      <link href="https://realpython.com/podcasts/rpp/12/"/>
      <updated>2020-06-05T12:00:00+00:00</updated>
      <summary>Do you want to get started with web scraping using Python? Are you concerned about the potential legal implications? What are the tools required and what are some of the best practices? This week on the show we have Kimberly Fessel to discuss her excellent tutorial created for PyCon 2020 online titled &quot;It&#x27;s Officially Legal so Let&#x27;s Scrape the Web.&quot;</summary>
      <content type="html">
        &lt;p&gt;Do you want to get started with web scraping using Python? Are you concerned about the potential legal implications? What are the tools required and what are some of the best practices? This week on the show we have Kimberly Fessel to discuss her excellent tutorial created for PyCon 2020 online titled &quot;It&#x27;s Officially Legal so Let&#x27;s Scrape the Web.&quot;&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Regular Expressions: Regexes in Python (Part 2)</title>
      <id>https://realpython.com/regex-python-part-2/</id>
      <link href="https://realpython.com/regex-python-part-2/"/>
      <updated>2020-06-03T14:00:00+00:00</updated>
      <summary>In the previous tutorial in this series, you learned how to perform sophisticated pattern matching using regular expressions, or regexes, in Python.  This tutorial explores more regex tools and techniques that are available in Python.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In the &lt;a href=&quot;https://realpython.com/regex-python&quot;&gt;previous tutorial&lt;/a&gt; in this series, you covered a lot of ground. You saw how to use &lt;code&gt;re.search()&lt;/code&gt; to perform pattern matching with regexes in Python and learned about the many regex metacharacters and parsing flags that you can use to fine-tune your pattern-matching capabilities.&lt;/p&gt;
&lt;p&gt;But as great as all that is, the &lt;code&gt;re&lt;/code&gt; module has much more to offer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Explore more functions, beyond &lt;code&gt;re.search()&lt;/code&gt;, that the &lt;code&gt;re&lt;/code&gt; module provides&lt;/li&gt;
&lt;li&gt;Learn when and how to precompile a regex in Python into a &lt;strong&gt;regular expression object&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Discover useful things that you can do with the &lt;strong&gt;match object&lt;/strong&gt; returned by the functions in the &lt;code&gt;re&lt;/code&gt; module&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ready? Let’s dig in!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Bonus:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-basics-sample-free-chapter/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-basics-sample-free-chapter&quot; data-focus=&quot;false&quot;&gt;Get a sample chapter from Python Basics: A Practical Introduction to Python 3&lt;/a&gt; to see how you can go from beginner to intermediate in Python with a complete curriculum, up-to-date for Python 3.8.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;re-module-functions&quot;&gt;&lt;code&gt;re&lt;/code&gt; Module Functions&lt;/h2&gt;
&lt;p&gt;In addition to &lt;code&gt;re.search()&lt;/code&gt;, the &lt;code&gt;re&lt;/code&gt; module contains several other functions to help you perform regex-related tasks.&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; You saw in the previous tutorial that &lt;code&gt;re.search()&lt;/code&gt; can take an optional &lt;code&gt;&amp;lt;flags&amp;gt;&lt;/code&gt; argument, which specifies &lt;a href=&quot;https://realpython.com/regex-python/#modifying-regular-expression-matching-with-flags&quot;&gt;flags&lt;/a&gt; that modify parsing behavior. All the functions shown below, with the exception of &lt;code&gt;re.escape()&lt;/code&gt;, support the &lt;code&gt;&amp;lt;flags&amp;gt;&lt;/code&gt; argument in the same way.&lt;/p&gt;
&lt;p&gt;You can specify &lt;code&gt;&amp;lt;flags&amp;gt;&lt;/code&gt; as either a positional argument or a keyword argument:&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;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;regex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;regex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The default for &lt;code&gt;&amp;lt;flags&amp;gt;&lt;/code&gt; is always &lt;code&gt;0&lt;/code&gt;, which indicates no special modification of matching behavior. Remember from the &lt;a href=&quot;https://realpython.com/regex-python/#supported-regular-expression-flags&quot;&gt;discussion of flags in the previous tutorial&lt;/a&gt; that the &lt;code&gt;re.UNICODE&lt;/code&gt; flag is always set by default.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The available regex functions in the Python &lt;code&gt;re&lt;/code&gt; module fall into the following three categories:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Searching functions&lt;/li&gt;
&lt;li&gt;Substitution functions&lt;/li&gt;
&lt;li&gt;Utility functions&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following sections explain these functions in more detail.&lt;/p&gt;
&lt;h3 id=&quot;searching-functions&quot;&gt;Searching Functions&lt;/h3&gt;
&lt;p&gt;Searching functions scan a search string for one or more matches of the specified regex:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;re.search()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Scans a string for a regex match&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;re.match()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Looks for a regex match at the beginning of a string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;re.fullmatch()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Looks for a regex match on an entire string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;re.findall()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Returns a list of all regex matches in a string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;re.finditer()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Returns an iterator that yields regex matches from a string&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;As you can see from the table, these functions are similar to one another. But each one tweaks the searching functionality in its own way.&lt;/p&gt;
&lt;!-- re.search() --&gt;

&lt;p class=&quot;h4 mt-4&quot;&gt;&lt;code&gt;re.search(&amp;lt;regex&amp;gt;, &amp;lt;string&amp;gt;, flags=0)&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Scans a string for a regex match.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you worked through the &lt;a href=&quot;https://realpython.com/regex-python/&quot;&gt;previous tutorial&lt;/a&gt; in this series, then you should be well familiar with this function by now. &lt;code&gt;re.search(&amp;lt;regex&amp;gt;, &amp;lt;string&amp;gt;)&lt;/code&gt; looks for any location in &lt;code&gt;&amp;lt;string&amp;gt;&lt;/code&gt; where &lt;code&gt;&amp;lt;regex&amp;gt;&lt;/code&gt; matches:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;span class=&quot;repl-toggle&quot; title=&quot;Toggle REPL prompts and output&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#x27;(\d+)&#x27;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#x27;foo123bar&#x27;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;_sre.SRE_Match object; span=(3, 6), match=&#x27;123&#x27;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#x27;[a-z]+&#x27;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#x27;123FOO456&#x27;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IGNORECASE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;_sre.SRE_Match object; span=(3, 6), match=&#x27;FOO&#x27;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#x27;\d+&#x27;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&#x27;foo.bar&#x27;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The function returns a match object if it finds a match and &lt;code&gt;None&lt;/code&gt; otherwise.&lt;/p&gt;
&lt;!-- re.match() --&gt;

&lt;p class=&quot;h4 mt-4&quot;&gt;&lt;code&gt;re.match(&amp;lt;regex&amp;gt;, &amp;lt;string&amp;gt;, flags=0)&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Looks for a regex match at the beginning of a string.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/regex-python-part-2/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/regex-python-part-2/ »&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>Parallel Iteration With Python&#x27;s zip() Function</title>
      <id>https://realpython.com/courses/python-zip-function/</id>
      <link href="https://realpython.com/courses/python-zip-function/"/>
      <updated>2020-06-02T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to use the Python zip() function to solve common programming problems. You&#x27;ll learn how to traverse multiple iterables in parallel and create dictionaries with just a few lines of code.</summary>
      <content type="html">
        &lt;p&gt;Python&amp;rsquo;s &lt;strong&gt;&lt;code&gt;zip()&lt;/code&gt;&lt;/strong&gt; function creates an &lt;strong&gt;iterator&lt;/strong&gt; that will aggregate elements from two or more iterables. You can use the resulting iterator to quickly and consistently solve common programming problems, like creating dictionaries. In this course, you&amp;rsquo;ll discover the logic behind the Python &lt;code&gt;zip()&lt;/code&gt; function and how you can use it to solve real-world problems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How &lt;strong&gt;&lt;code&gt;zip()&lt;/code&gt;&lt;/strong&gt; works in both Python 3 and Python 2&lt;/li&gt;
&lt;li&gt;How to use the Python &lt;code&gt;zip()&lt;/code&gt; function for &lt;strong&gt;parallel iteration&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;create dictionaries&lt;/strong&gt; on the fly using &lt;code&gt;zip()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Build Physical Projects With Python on the Raspberry Pi</title>
      <id>https://realpython.com/python-raspberry-pi/</id>
      <link href="https://realpython.com/python-raspberry-pi/"/>
      <updated>2020-06-01T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn to use Python on the Raspberry Pi. The Raspberry Pi is one of the leading physical computing boards on the market and a great way to get started using Python to interact with the physical world.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The Raspberry Pi is one of the leading &lt;a href=&quot;https://en.wikipedia.org/wiki/Physical_computing&quot;&gt;physical computing&lt;/a&gt; boards on the market. From hobbyists building DIY projects to students learning to program for the first time, people use the Raspberry Pi every day to interact with the world around them. Python comes built in on the Raspberry Pi, so you can take your skills and start building your own Raspberry Pi projects today.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set up a new &lt;strong&gt;Raspberry Pi&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Run Python on the Raspberry Pi using the &lt;strong&gt;Mu editor&lt;/strong&gt; or remotely over &lt;strong&gt;SSH&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;Read input from &lt;strong&gt;physical sensors&lt;/strong&gt; connected to the Raspberry Pi&lt;/li&gt;
&lt;li&gt;Send output to &lt;strong&gt;external components&lt;/strong&gt; using Python&lt;/li&gt;
&lt;li&gt;Create unique projects with Python on the Raspberry Pi&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let’s get started!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Free Download:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-tricks-sample-pdf/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-tricks-sample-pdf&quot; data-focus=&quot;false&quot;&gt;Get a sample chapter from Python Tricks: The Book&lt;/a&gt; that shows you Python&#x27;s best practices with simple examples you can apply instantly to write more beautiful + Pythonic code.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;getting-to-know-the-raspberry-pi&quot;&gt;Getting to Know the Raspberry Pi&lt;/h2&gt;
&lt;p&gt;The Raspberry Pi is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Single-board_computer&quot;&gt;single-board computer&lt;/a&gt; developed by the &lt;a href=&quot;https://www.raspberrypi.org/about/&quot;&gt;Raspberry Pi Foundation&lt;/a&gt;, a UK-based charity organization. Originally designed to provide young people with an affordable computing option to learn how to program, it has developed a massive following in the maker and DIY communities because of its compact size, full Linux environment, and general-purpose input–output (&lt;strong&gt;GPIO&lt;/strong&gt;) pins.&lt;/p&gt;
&lt;p&gt;With all the features and capabilities that are packed into this small board, there’s no shortage of projects and use cases for the Raspberry Pi.&lt;/p&gt;
&lt;p&gt;Some example projects include the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://projects.raspberrypi.org/en/projects/rpi-python-line-following&quot;&gt;Line-following robot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://projects.raspberrypi.org/en/projects/build-your-own-weather-station&quot;&gt;Home weather station&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://retropie.org.uk/&quot;&gt;Retro gaming machine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://maker.pro/raspberry-pi/projects/how-to-use-raspberry-pi-and-tensorflow-for-real-time-object-detection&quot;&gt;Real-time object detection camera&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.makeuseof.com/tag/setup-minecraft-server-raspberry-pi/&quot;&gt;Minecraft server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://projects.raspberrypi.org/en/projects/gpio-music-box&quot;&gt;Button-controlled music box&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://mediaexperience.com/raspberry-pi-xbmc-with-raspbmc/&quot;&gt;Media center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.raspberrypi.org/education/programmes/astro-pi/&quot;&gt;Remote experiments on the International Space Station&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you can think of a project that would benefit from having a credit card–sized computer attached to it, then someone has probably used a Raspberry Pi to do it. The Raspberry Pi is a fantastic way to bring your Python project ideas to life.&lt;/p&gt;
&lt;h3 id=&quot;raspberry-pi-board-overview&quot;&gt;Raspberry Pi Board Overview&lt;/h3&gt;
&lt;p&gt;The Raspberry Pi comes in a variety of &lt;a href=&quot;https://www.raspberrypi.org/products/&quot;&gt;form factors&lt;/a&gt; for different use cases. In this tutorial, you’ll be looking at the most recent version, the &lt;a href=&quot;https://www.raspberrypi.org/products/raspberry-pi-4-model-b/&quot;&gt;Raspberry Pi 4&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Below is the board layout of the Raspberry Pi 4. While this layout is slightly different from previous models of the Raspberry Pi, most of the connections are the same. The setup described in the next section should be the same for both a Raspberry Pi 3 and a Raspberry Pi 4:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://files.realpython.com/media/python-raspberry-pi-board-components.130884cd8ee7.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/python-raspberry-pi-board-components.130884cd8ee7.jpg&quot; width=&quot;1992&quot; height=&quot;1460&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/python-raspberry-pi-board-components.130884cd8ee7.jpg&amp;amp;w=498&amp;amp;sig=46cf1297a49b9b0150136205f73c76827f8ebbeb 498w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/python-raspberry-pi-board-components.130884cd8ee7.jpg&amp;amp;w=996&amp;amp;sig=e958fc63da679e1d93857bbd276c21aa77e6014e 996w, https://files.realpython.com/media/python-raspberry-pi-board-components.130884cd8ee7.jpg 1992w&quot; sizes=&quot;75vw&quot; alt=&quot;Raspberry Pi 4 Board Components&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Raspberry Pi 4 board contains the following components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;General-purpose input–output pins:&lt;/strong&gt; These pins are used to connect the Raspberry Pi to electronic components.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Ethernet port:&lt;/strong&gt; This port connects the Raspberry Pi to a wired network. The Raspberry Pi also has WiFi and Bluetooth built in for wireless connections.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Two USB 3.0 and two USB 2.0 ports:&lt;/strong&gt; These USB ports are used to connect peripherals like a keyboard or mouse. The two black ports are USB 2.0 and the two blue ports are USB 3.0.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AV jack:&lt;/strong&gt; This AV jack allows you to connect speakers or headphones to the Raspberry Pi.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Camera Module port:&lt;/strong&gt; This port is used to connect the &lt;a href=&quot;https://www.raspberrypi.org/products/camera-module-v2/&quot;&gt;official Raspberry Pi Camera Module&lt;/a&gt;, which enables the Raspberry Pi to capture images.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;HDMI ports:&lt;/strong&gt; These HDMI ports connect the Raspberry Pi to external monitors. The Raspberry Pi 4 features two micro HDMI ports, allowing it to drive two separate monitors at the same time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;USB power port:&lt;/strong&gt; This USB port powers the Raspberry Pi. The Raspberry Pi 4 has a &lt;strong&gt;USB Type-C&lt;/strong&gt; port, while older versions of the Pi have a &lt;strong&gt;micro-USB&lt;/strong&gt; port.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;External display port:&lt;/strong&gt; This port is used to connect the official seven-inch Raspberry Pi &lt;a href=&quot;https://www.raspberrypi.org/products/raspberry-pi-touch-display/&quot;&gt;touch display&lt;/a&gt; for touch-based input on the Raspberry Pi.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;microSD card slot (underside of the board):&lt;/strong&gt; This card slot is for the microSD card that contains the Raspberry Pi operating system and files.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A little later in this tutorial, you’ll use the components above to set up your Raspberry Pi.&lt;/p&gt;
&lt;h3 id=&quot;raspberry-pi-vs-arduino&quot;&gt;Raspberry Pi vs Arduino&lt;/h3&gt;
&lt;p&gt;People often wonder what the difference is between a Raspberry Pi and an Arduino. The Arduino is another device that is widely used in physical computing. While there is some overlap in the capabilities of the Arduino and the Raspberry Pi, there are some distinct differences.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://realpython.com/arduino-python/#the-arduino-platform&quot;&gt;The Arduino platform&lt;/a&gt; provides a hardware and software interface for programming &lt;a href=&quot;https://en.wikipedia.org/wiki/Microcontroller&quot;&gt;microcontrollers&lt;/a&gt;. A microcontroller is an &lt;a href=&quot;https://en.wikipedia.org/wiki/Integrated_circuit&quot;&gt;integrated circuit&lt;/a&gt; that allows you to read input from and send output to electronic components. Arduino boards generally have limited memory, so they’re often used to repeatedly run a single program that interacts with electronics.&lt;/p&gt;
&lt;p&gt;The Raspberry Pi is a general-purpose, Linux-based computer. It has a full operating system with a GUI interface that is capable of running many different programs at the same time. &lt;/p&gt;
&lt;p&gt;The Raspberry Pi comes with a variety of software preinstalled, including a web browser, an office suite, a terminal, and even Minecraft. The Raspberry Pi also has built-in WiFi and Bluetooth to connect to the Internet and external peripherals.&lt;/p&gt;
&lt;p&gt;For running Python, the Raspberry Pi is often the better choice, as you get a full-fledged Python installation out of the box without any configuration.&lt;/p&gt;
&lt;h2 id=&quot;setting-up-the-raspberry-pi&quot;&gt;Setting Up the Raspberry Pi&lt;/h2&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-raspberry-pi/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-raspberry-pi/ »&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 #11: Advice on Getting Started With Testing in Python</title>
      <id>https://realpython.com/podcasts/rpp/11/</id>
      <link href="https://realpython.com/podcasts/rpp/11/"/>
      <updated>2020-05-29T12:00:00+00:00</updated>
      <summary>Have you wanted to get started with testing in Python? Maybe you feel a little nervous about diving in deeper than just confirming your code runs. What are the tools needed and what would be the next steps to level up your Python testing? This week on the show we have Anthony Shaw to discuss his article on this subject. Anthony is a member of the Real Python team and has written several articles for the site.</summary>
      <content type="html">
        &lt;p&gt;Have you wanted to get started with testing in Python? Maybe you feel a little nervous about diving in deeper than just confirming your code runs. What are the tools needed and what would be the next steps to level up your Python testing? This week on the show we have Anthony Shaw to discuss his article on this subject. Anthony is a member of the Real Python team and has written several articles for the site.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>A Beginner&#x27;s Guide to Pip</title>
      <id>https://realpython.com/courses/what-is-pip/</id>
      <link href="https://realpython.com/courses/what-is-pip/"/>
      <updated>2020-05-26T14:00:00+00:00</updated>
      <summary>What is pip? In this beginner-friendly course, you&#x27;ll learn how to use pip, the standard package manager for Python, so that you can install and manage additional packages that are not part of the Python standard library.</summary>
      <content type="html">
        &lt;p&gt;What is &lt;code&gt;pip&lt;/code&gt;? &lt;a href=&quot;https://pip.pypa.io/en/stable/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt; is the standard package manager for &lt;a href=&quot;https://www.python.org/&quot;&gt;Python&lt;/a&gt;. It allows you to install and manage additional packages that are not part of the &lt;a href=&quot;https://docs.python.org/3/py-modindex.html&quot;&gt;Python standard library&lt;/a&gt;. This course is an introduction to &lt;code&gt;pip&lt;/code&gt; for new Pythonistas.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn about:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Installing additional packages not included with the standard Python distribution&lt;/li&gt;
&lt;li&gt;Finding packages published to the &lt;a href=&quot;https://pypi.org/&quot;&gt;Python Package Index (PyPI)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Managing requirements for your scripts and applications&lt;/li&gt;
&lt;li&gt;Uninstalling packages and their dependencies&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you&amp;rsquo;ll see, the Python community is very active and has created some neat alternatives to &lt;code&gt;pip&lt;/code&gt; that you&amp;rsquo;ll learn about later in this course.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #10: Python Job Hunting in a Pandemic</title>
      <id>https://realpython.com/podcasts/rpp/10/</id>
      <link href="https://realpython.com/podcasts/rpp/10/"/>
      <updated>2020-05-22T12:00:00+00:00</updated>
      <summary>Do you know someone in the Python community who recently was let go from their job due to the pandemic? What does the job landscape currently look like? What are skills and techniques that will help you in your job search? This week we have Kyle Stratis on the show to discuss how he is managing his job search after just being let go from his data engineering job. Kyle is a member of the Real Python team and has written several articles for the site.</summary>
      <content type="html">
        &lt;p&gt;Do you know someone in the Python community who recently was let go from their job due to the pandemic? What does the job landscape currently look like? What are skills and techniques that will help you in your job search? This week we have Kyle Stratis on the show to discuss how he is managing his job search after just being let go from his data engineering job. Kyle is a member of the Real Python team and has written several articles for the site.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Convert a Python String to int</title>
      <id>https://realpython.com/courses/convert-python-string-int/</id>
      <link href="https://realpython.com/courses/convert-python-string-int/"/>
      <updated>2020-05-19T14:00:00+00:00</updated>
      <summary>There are several ways to represent integers in Python. In this quick and practical course, you&#x27;ll learn how you can store integers using int and str as well as how you can convert a Python string to an int and vice versa.</summary>
      <content type="html">
        &lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Integer&quot;&gt;&lt;strong&gt;Integers&lt;/strong&gt;&lt;/a&gt; are whole numbers. In other words, they have no fractional component. Two data types you can use to store an integer in Python are &lt;strong&gt;&lt;a href=&quot;https://realpython.com/python-data-types/#integers&quot;&gt;&lt;code&gt;int&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a href=&quot;https://realpython.com/python-data-types/#strings&quot;&gt;&lt;code&gt;str&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;. These types offer flexibility for working with integers in different circumstances. In this course, you&amp;rsquo;ll learn how you can convert a Python string to an &lt;code&gt;int&lt;/code&gt;. You&amp;rsquo;ll also learn how to convert an &lt;code&gt;int&lt;/code&gt; to a string.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll understand how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Store integers using &lt;code&gt;str&lt;/code&gt; and &lt;code&gt;int&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Convert a Python string to an &lt;code&gt;int&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Convert a Python &lt;code&gt;int&lt;/code&gt; to a string&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #9: Leveling Up Your Python Literacy and Finding Python Projects to Study</title>
      <id>https://realpython.com/podcasts/rpp/9/</id>
      <link href="https://realpython.com/podcasts/rpp/9/"/>
      <updated>2020-05-15T12:00:00+00:00</updated>
      <summary>In your quest to become a better developer, how do you find Python code that is at your reading level? What are good code bases or projects to study? What are the things holding you back from leveling up your Python literacy? This week we have Cecil Phillip on the show to discuss all of these common questions. Cecil is a Senior Cloud Advocate at Microsoft.</summary>
      <content type="html">
        &lt;p&gt;In your quest to become a better developer, how do you find Python code that is at your reading level? What are good code bases or projects to study? What are the things holding you back from leveling up your Python literacy? This week we have Cecil Phillip on the show to discuss all of these common questions. Cecil is a Senior Cloud Advocate at Microsoft.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Improve Your Tests With the Python Mock Object Library</title>
      <id>https://realpython.com/courses/python-mock-object-library/</id>
      <link href="https://realpython.com/courses/python-mock-object-library/"/>
      <updated>2020-05-12T14:00:00+00:00</updated>
      <summary>In this course, you&#x27;ll learn how to use the Python mock object library, unittest.mock, to create and use mock objects to improve your tests. Obstacles like complex logic and unpredictable dependencies make writing valuable tests difficult, but unittest.mock can help you overcome these obstacles.</summary>
      <content type="html">
        &lt;p&gt;When you&amp;rsquo;re writing robust code, &lt;strong&gt;tests&lt;/strong&gt; are essential for verifying that your application logic is correct, reliable, and efficient. However, the value of your tests depends on how well they demonstrate these criteria. Obstacles such as &lt;strong&gt;complex logic&lt;/strong&gt; and unpredictable &lt;strong&gt;dependencies&lt;/strong&gt; make writing valuable tests difficult. The Python mock object library, &lt;strong&gt;&lt;code&gt;unittest.mock&lt;/code&gt;&lt;/strong&gt;, can help you overcome these obstacles.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create Python mock objects using &lt;code&gt;Mock&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Assert that you&amp;rsquo;re using objects as you intended&lt;/li&gt;
&lt;li&gt;Inspect usage data stored on your Python mocks&lt;/li&gt;
&lt;li&gt;Configure certain aspects of your Python mock objects&lt;/li&gt;
&lt;li&gt;Substitute your mocks for real objects using &lt;code&gt;patch()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Avoid common problems inherent in Python mocking&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You&amp;rsquo;ll begin by seeing what mocking is and how it will improve your tests!&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #8: Docker + Python for Data Science and Machine Learning</title>
      <id>https://realpython.com/podcasts/rpp/8/</id>
      <link href="https://realpython.com/podcasts/rpp/8/"/>
      <updated>2020-05-08T12:00:00+00:00</updated>
      <summary>Docker is a common tool for Python developers creating and deploying applications, but what do you need to know if you want to use Docker for data science and machine learning? What are the best practices if you want to start using containers for your scientific projects? This week we have Tania Allard on the show. She is a Sr. Developer Advocate at Microsoft focusing on Machine Learning, scientific computing, research and open source.</summary>
      <content type="html">
        &lt;p&gt;Docker is a common tool for Python developers creating and deploying applications, but what do you need to know if you want to use Docker for data science and machine learning? What are the best practices if you want to start using containers for your scientific projects? This week we have Tania Allard on the show. She is a Sr. Developer Advocate at Microsoft focusing on Machine Learning, scientific computing, research and open source.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Python print() Function: Go Beyond the Basics</title>
      <id>https://realpython.com/courses/python-print/</id>
      <link href="https://realpython.com/courses/python-print/"/>
      <updated>2020-05-05T14:00:00+00:00</updated>
      <summary>In this step-by-step course, you&#x27;ll learn about the print() function in Python and discover some of its lesser-known features. Avoid common mistakes, take your &quot;hello world&quot; to the next level, and know when to use a better alternative.</summary>
      <content type="html">
        &lt;p&gt;If you&amp;rsquo;re like most Python users, including us, then you probably started your Python journey by learning about &lt;strong&gt;&lt;code&gt;print()&lt;/code&gt;&lt;/strong&gt;. It helped you write your very own &lt;code&gt;Hello Horld&lt;/code&gt; one-liner. You can use it to display formatted messages onto the screen and perhaps find some bugs. But if you think that&amp;rsquo;s all there is to know about Python&amp;rsquo;s &lt;code&gt;print()&lt;/code&gt;, then you&amp;rsquo;re missing out on a lot!&lt;/p&gt;
&lt;p&gt;Keep reading to take full advantage of this underappreciated little function. This course will get you up to speed with using Python &lt;code&gt;print()&lt;/code&gt; effectively. Prepare for a deep dive as you go through the sections. You may be surprised how much &lt;code&gt;print()&lt;/code&gt; has to offer!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll know how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Avoid common mistakes with Python&amp;rsquo;s &lt;code&gt;print()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Deal with newlines, character encodings, and buffering&lt;/li&gt;
&lt;li&gt;Write text to files&lt;/li&gt;
&lt;li&gt;Mock &lt;code&gt;print()&lt;/code&gt; in unit tests&lt;/li&gt;
&lt;li&gt;Build advanced user interfaces in the terminal&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; &lt;code&gt;print()&lt;/code&gt; was a major addition to Python 3, in which it replaced the old &lt;code&gt;print&lt;/code&gt; statement available in Python 2.&lt;/p&gt;
&lt;p&gt;There were a number of good reasons for that, as you&amp;rsquo;ll see shortly. Although this tutorial focuses on Python 3, it does show the old way of printing in Python for reference.&lt;/p&gt;
&lt;/div&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 #7: AsyncIO + Music, Origins of Black, and Managing Python Releases</title>
      <id>https://realpython.com/podcasts/rpp/7/</id>
      <link href="https://realpython.com/podcasts/rpp/7/"/>
      <updated>2020-05-01T12:00:00+00:00</updated>
      <summary>Want to learn more about AsyncIO in Python, with an example where you can see and hear events being triggered in real-time? This week we have Łukasz Langa on the show. Łukasz has created a talk for PyCon 2020 online about using AsyncIO with Music.</summary>
      <content type="html">
        &lt;p&gt;Want to learn more about AsyncIO in Python, with an example where you can see and hear events being triggered in real-time? This week we have Łukasz Langa on the show. Łukasz has created a talk for PyCon 2020 online about using AsyncIO with Music.&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>Structuring a Python Application</title>
      <id>https://realpython.com/courses/structuring-python-application/</id>
      <link href="https://realpython.com/courses/structuring-python-application/"/>
      <updated>2020-04-28T14:00:00+00:00</updated>
      <summary>This course is a reference guide to common Python application layouts and project structures for command-line applications, web applications, and more.</summary>
      <content type="html">
        &lt;p&gt;Python, though opinionated on syntax and style, is surprisingly flexible when it comes to &lt;strong&gt;structuring your applications&lt;/strong&gt;. On the one hand, this flexibility is great: it allows different use cases to use structures that are necessary for those use cases. On the other hand, though, it can be very confusing to the new developer. The Internet isn&amp;rsquo;t a lot of help either. There are as many opinions as there are Python blogs!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Walk through a dependable &lt;strong&gt;Python application layout reference guide&lt;/strong&gt; that you can refer to for most use cases&lt;/li&gt;
&lt;li&gt;See examples of common Python application structures, including &lt;strong&gt;command-line applications&lt;/strong&gt; (CLI apps), one-off &lt;strong&gt;scripts&lt;/strong&gt;, installable &lt;strong&gt;packages&lt;/strong&gt;, and web application layouts with &lt;strong&gt;popular frameworks&lt;/strong&gt; like &lt;a href=&quot;https://realpython.com/tutorials/flask/&quot;&gt;Flask&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/tutorials/django/&quot;&gt;Django&lt;/a&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 #6: Python REST APIs and The Well-Grounded Python Developer</title>
      <id>https://realpython.com/podcasts/rpp/6/</id>
      <link href="https://realpython.com/podcasts/rpp/6/"/>
      <updated>2020-04-24T12:00:00+00:00</updated>
      <summary>Are you interested in building REST APIs with Flask and SQLAlchemy? This week we have Doug Farrell on the show. We talk about his four-part Real Python article series on Python REST APIs.</summary>
      <content type="html">
        &lt;p&gt;Are you interested in building REST APIs with Flask and SQLAlchemy? This week we have Doug Farrell on the show. We talk about his four-part Real Python article series on Python REST APIs.&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>
