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

  
    <entry>
      <title>The Real Python Podcast – Episode #184: PyCoder&#x27;s Weekly 2023 Wrap Up</title>
      <id>https://realpython.com/podcasts/rpp/184/</id>
      <link href="https://realpython.com/podcasts/rpp/184/"/>
      <updated>2023-12-22T12:00:00+00:00</updated>
      <summary>It&#x27;s been a fascinating year for the Python language and community. PyCoder&#x27;s Weekly included over 1,500 links to articles, blog posts, tutorials, and projects in 2023. Christopher Trudeau is back on the show this week to help wrap up everything by sharing some highlights and Python trends from across the year.</summary>
      <content type="html">
        &lt;p&gt;It&#x27;s been a fascinating year for the Python language and community. PyCoder&#x27;s Weekly included over 1,500 links to articles, blog posts, tutorials, and projects in 2023. Christopher Trudeau is back on the show this week to help wrap up everything by sharing some highlights and Python trends from across the year.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Add Logging and Notification Messages to Flask Web Projects</title>
      <id>https://realpython.com/flask-logging-messages/</id>
      <link href="https://realpython.com/flask-logging-messages/"/>
      <updated>2023-12-20T14:00:00+00:00</updated>
      <summary>After you implement the main functionality of a web project, it&#x27;s good to understand how your users interact with your app and where they may run into errors. In this tutorial, you&#x27;ll enhance your Flask project by creating error pages and logging messages.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;After implementing the main functionality of a web project, you may find that your app is rough around the edges. Often, this boils down to the user experience (UX) of your project. For example, when you send a form, you don’t receive a success message, although everything worked fine. You want to build an immersive experience, but wrong URLs display unwelcoming error messages. Luckily, you can get valuable information from Flask through logging.&lt;/p&gt;
&lt;p&gt;As an admin of a web project, you may know how to navigate your app without running into errors. But looking at the messages that the server sends you, you may notice that not all users do. That’s when a more verbose logging system can give you insights.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create &lt;strong&gt;error pages&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Improve the user experience with &lt;strong&gt;notification messages&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Gain information with &lt;strong&gt;logging&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Adding features like the ones listed above may keep your current functionality intact and enhance your web project with a better user experience that your visitors will love.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/flask-logging-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-flask-logging-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free source code&lt;/a&gt; that shows you how to add error pages and logging to your Flask app.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;headerlink&quot; href=&quot;#prerequisites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You’ll gain the most value from this tutorial if you’ve already created one or more &lt;a href=&quot;https://realpython.com/flask-project/&quot;&gt;Flask web projects&lt;/a&gt; yourself. It’ll also be helpful if you’ve worked with &lt;a href=&quot;https://realpython.com/primer-on-jinja-templating/&quot;&gt;Jinja templating&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/html-css-python/&quot;&gt;HTML and CSS&lt;/a&gt; before.&lt;/p&gt;
&lt;p&gt;Also, you should be comfortable using the &lt;a href=&quot;https://realpython.com/terminal-commands/&quot;&gt;terminal&lt;/a&gt; and have &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;basic knowledge&lt;/a&gt; of Python. Although it helps to know about &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environments&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;, you’ll learn how to set everything up as you work through the tutorial.&lt;/p&gt;
&lt;h2 id=&quot;project-overview&quot;&gt;Project Overview&lt;a class=&quot;headerlink&quot; href=&quot;#project-overview&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this tutorial, you’ll continue to work on an existing Flask project. The project at hand is a public message board.&lt;/p&gt;
&lt;p&gt;You’ll start with an existing Flask project and then implement logging and notification messages:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 border&quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/892852624?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/figure&gt;

&lt;p&gt;The demo video above shows the Flask project on the left and the terminal with server logs on the right. When you interact with the web app, you get helpful feedback with notification messages. As an admin, you can also see the info messages in your logs to help you understand how your users interact with your app.&lt;/p&gt;
&lt;p&gt;In the next step, you’ll download the source code of the &lt;a href=&quot;https://realpython.com/flask-database/&quot;&gt;Flask project&lt;/a&gt;. However, you’ll notice that the codebase is quite generic so that you can transfer the instructions of this tutorial into your own Flask project.&lt;/p&gt;
&lt;h2 id=&quot;get-started&quot;&gt;Get Started&lt;a class=&quot;headerlink&quot; href=&quot;#get-started&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this section, you’ll download all the requirements that you need for this tutorial and set up the development environment.
Generally, you can leverage this tutorial to expand any Flask project that you’re currently working on.
However, if you want to follow along closely, then you should perform the steps outlined below.&lt;/p&gt;
&lt;h3 id=&quot;grab-the-prerequisites&quot;&gt;Grab the Prerequisites&lt;a class=&quot;headerlink&quot; href=&quot;#grab-the-prerequisites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To hit the ground running, you’ll build up on an existing &lt;a href=&quot;https://realpython.com/flask-database/&quot;&gt;Flask project with a database&lt;/a&gt;.
That way, you don’t need to create a Flask project from scratch. Instead, you can focus on the main objectives of this tutorial, like adding an error page and displaying helpful messages to your users.&lt;/p&gt;
&lt;p&gt;The code that you need is already in place for you. All you need to do is download the source code by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/flask-logging-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-flask-logging-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free source code&lt;/a&gt; that shows you how to add error pages and logging to your Flask app.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Alternatively, you can follow the &lt;a href=&quot;https://realpython.com/flask-database/&quot;&gt;Flask project with a database&lt;/a&gt; tutorial. Either way, you should end up with a folder structure that looks like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;rp_flask_board/
├── board/
│   │
│   ├── static/
│   │   └── styles.css
│   │
│   ├── templates/
│   │   │
│   │   ├── pages/
│   │   │   ├── about.html
│   │   │   └── home.html
│   │   │
│   │   ├── posts/
│   │   │   ├── create.html
│   │   │   └── posts.html
│   │   │
│   │   ├── _navigation.html
│   │   └── base.html
│   │
│   ├── __init__.py
│   ├── database.py
│   ├── pages.py
│   ├── posts.py
│   └── schema.sql
│
└── board.sqlite
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Once you’ve got the folder structure for your Flask project in place, you can read on to prepare the development environment that you’ll need to work on your web app.&lt;/p&gt;
&lt;h3 id=&quot;prepare-your-development-environment&quot;&gt;Prepare Your Development Environment&lt;a class=&quot;headerlink&quot; href=&quot;#prepare-your-development-environment&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/flask-logging-messages/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/flask-logging-messages/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Basics Exercises: Reading and Writing Files</title>
      <id>https://realpython.com/courses/python-exercises-reading-writing-files/</id>
      <link href="https://realpython.com/courses/python-exercises-reading-writing-files/"/>
      <updated>2023-12-19T14:00:00+00:00</updated>
      <summary>In this video tutorial, you&#x27;ll practice transferring data between your Python programs and external software by reading and writing files. Through exercises, you&#x27;ll master the art of reading and writing information saved in CSV file format, which is extensively used for exchanging tabular data.</summary>
      <content type="html">
        &lt;p&gt;Files play a key role in computing, as they store and transfer data. You likely come across numerous files on a daily basis. In &lt;a href=&quot;https://realpython.com/courses/python-reading-and-writing-files/&quot;&gt;Python Basics: Reading and Writing Files&lt;/a&gt;, you dove into the world of file manipulation using Python.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll practice:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Differentiating between &lt;strong&gt;text&lt;/strong&gt; and &lt;strong&gt;binary&lt;/strong&gt; files&lt;/li&gt;
&lt;li&gt;Using &lt;strong&gt;character encodings&lt;/strong&gt; and &lt;strong&gt;line endings&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Manipulating &lt;strong&gt;file objects&lt;/strong&gt; in Python&lt;/li&gt;
&lt;li&gt;Reading and writing character data with different &lt;strong&gt;file modes&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;open()&lt;/code&gt;, &lt;code&gt;Path.open()&lt;/code&gt;, and the &lt;code&gt;with&lt;/code&gt; statement&lt;/li&gt;
&lt;li&gt;Leveraging the &lt;code&gt;csv&lt;/code&gt; module to manipulate &lt;strong&gt;CSV data&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is part of the Python Basics series, which is complements the book &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. Additionally, you can explore other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please note that throughout this course, you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt;. If you&amp;rsquo;re new to Python, then you might want to check out &lt;a href=&quot;https://realpython.com/courses/setting-up-python/&quot;&gt;Python Basics: Setting Up Python&lt;/a&gt; before diving into 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>Enhance Your Flask Web Project With a Database</title>
      <id>https://realpython.com/flask-database/</id>
      <link href="https://realpython.com/flask-database/"/>
      <updated>2023-12-18T14:00:00+00:00</updated>
      <summary>Adding a database to your Flask project elevates your web app to the next level. In this tutorial, you&#x27;ll learn how to connect your Flask app to a database and how to receive and store posts from users.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Adding a database to your Flask project comes with many advantages.
By connecting a database, you’ll be able to store user information, monitor user interactions, and maintain dynamic site content.&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;Hide secrets in &lt;strong&gt;environment variables&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Formulate your database structure with &lt;strong&gt;models&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Connect your Flask app with a &lt;strong&gt;database&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Receive data from users with &lt;strong&gt;forms&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By the end of this tutorial, you’ll have a robust understanding of how to connect your Flask app to a database and how to leverage this connection to expand your project’s capabilities.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/flask-database-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-flask-database-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free source code&lt;/a&gt; for connecting a database to your Flask project.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;headerlink&quot; href=&quot;#prerequisites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You’ll gain the most value from this tutorial if you’ve already created one or more &lt;a href=&quot;https://realpython.com/flask-project/&quot;&gt;Flask web projects&lt;/a&gt; yourself.&lt;/p&gt;
&lt;p&gt;Also, you should be comfortable using the &lt;a href=&quot;https://realpython.com/terminal-commands/&quot;&gt;terminal&lt;/a&gt; and have &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;basic knowledge&lt;/a&gt; of Python. Although it helps to know about &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environments&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;, you’ll learn how to set everything up as you work through the tutorial.&lt;/p&gt;
&lt;h2 id=&quot;project-overview&quot;&gt;Project Overview&lt;a class=&quot;headerlink&quot; href=&quot;#project-overview&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this tutorial, you’ll continue to work on an existing Flask project. The project at hand is a public message board.&lt;/p&gt;
&lt;p&gt;You’ll start with an existing Flask project and then implement forms and a database. In the end, you can post and save messages:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 border&quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/892852608?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/figure&gt;

&lt;p&gt;In the demo vide above, you get an impression of how you can interact with the message board. However, the functionality is very similar to other interactions with a web app. If you feel inspired to adjust the project to your needs, then this Flask project is the perfect starting ground for that.&lt;/p&gt;
&lt;p&gt;In the next step, you’ll download the source code of the &lt;a href=&quot;https://realpython.com/flask-project/&quot;&gt;Flask boilerplate project&lt;/a&gt;. However, you’ll notice that the codebase is quite generic so that you can transfer the instructions of this tutorial into your own Flask project.&lt;/p&gt;
&lt;h2 id=&quot;get-started&quot;&gt;Get Started&lt;a class=&quot;headerlink&quot; href=&quot;#get-started&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this section, you’ll download all the requirements that you need for this tutorial and set up the development environment.
Generally, you can leverage this tutorial to expand any Flask project that you’re currently working on.
However, if you want to follow along closely, then you should perform the steps outlined below.&lt;/p&gt;
&lt;h3 id=&quot;grab-the-prerequisites&quot;&gt;Grab the Prerequisites&lt;a class=&quot;headerlink&quot; href=&quot;#grab-the-prerequisites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To hit the ground running, you’ll build upon an existing &lt;a href=&quot;https://realpython.com/flask-project/&quot;&gt;Flask boilerplate project&lt;/a&gt;.
That way, you don’t need to create a Flask project from scratch. Instead, you can focus on the main objectives of this tutorial, like adding a database and working with forms.&lt;/p&gt;
&lt;p&gt;The code that you need is already in place for you. All you need to do is download the source code by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/flask-database-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-flask-database-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free source code&lt;/a&gt; for connecting a database to your Flask project.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Alternatively, you can follow the &lt;a href=&quot;https://realpython.com/flask-project/&quot;&gt;Flask boilerplate project&lt;/a&gt; tutorial. Either way, you should end up with a folder structure that looks like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;rp_flask_board/
│
└── board/
    │
    ├── static/
    │   └── styles.css
    │
    ├── templates/
    │   │
    │   ├── pages/
    │   │   ├── about.html
    │   │   └── home.html
    │   │
    │   ├── _navigation.html
    │   └── base.html
    │
    ├── __init__.py
    └── pages.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Once you’ve got the folder structure for your Flask project in place, you can read on to prepare the development environment that you’ll need to work on your web app.&lt;/p&gt;
&lt;h3 id=&quot;prepare-your-development-environment&quot;&gt;Prepare Your Development Environment&lt;a class=&quot;headerlink&quot; href=&quot;#prepare-your-development-environment&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Before you continue working on your Flask project, it’s a good idea to create and activate a &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt;. That way, you’re installing any project dependencies not system-wide but only in your project’s virtual environment.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/flask-database/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/flask-database/ »&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>Build a Scalable Flask Web Project From Scratch</title>
      <id>https://realpython.com/flask-project/</id>
      <link href="https://realpython.com/flask-project/"/>
      <updated>2023-12-13T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll explore the process of creating a boilerplate for a Flask web project. It&#x27;s a great starting point for any scalable Flask web app that you wish to develop in the future, from basic web pages to complex web applications.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Flask is a powerful and flexible micro web framework for Python, ideal for both small and large web projects. It provides a straightforward way to get a web application up and running, with all the features that you need to get started.&lt;/p&gt;
&lt;p&gt;Over the course of this tutorial, you’ll explore the process of creating a boilerplate for a Flask web project. This boilerplate will serve as a great starting point for any scalable Flask web app that you wish to develop in the future, from basic web pages to complex web applications.&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;Set up a &lt;strong&gt;Flask project&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Create a &lt;code&gt;&quot;Hello, World!&quot;&lt;/code&gt; &lt;strong&gt;Flask app&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Add &lt;strong&gt;multiple pages&lt;/strong&gt; with blueprints&lt;/li&gt;
&lt;li&gt;Leverage &lt;strong&gt;Jinja templates&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Store &lt;strong&gt;static files&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At the end of this tutorial, you’ll have created a working Flask web application that you can use to bootstrap your future Flask projects.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/flask-project-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-flask-project-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free source code&lt;/a&gt; that shows you how to build a Flask project boilerplate.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;headerlink&quot; href=&quot;#prerequisites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You don’t need any previous knowledge of Flask to complete this project. If you want to learn more about the topics that you encounter in this tutorial, then you’ll find links to resources along the way.&lt;/p&gt;
&lt;p&gt;However, you should be comfortable using the &lt;a href=&quot;https://realpython.com/terminal-commands/&quot;&gt;terminal&lt;/a&gt; and have &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;basic knowledge&lt;/a&gt; of Python. Although it helps to know about &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environments&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;, you’ll learn how to set everything up as you work through the tutorial.&lt;/p&gt;
&lt;h2 id=&quot;project-overview&quot;&gt;Project Overview&lt;a class=&quot;headerlink&quot; href=&quot;#project-overview&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this tutorial, you’ll start building a Flask project, which could become a public message board at some point.
Here’s what the project will look at the end of this tutorial:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 border&quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/892852597?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/figure&gt;

&lt;p&gt;You create a basic Flask project with two pages that inherit content and style from a parent template.&lt;/p&gt;
&lt;p&gt;The Flask project that you’ll build in this tutorial will be very generic.
That way, it’s the perfect base for any of your future projects. For example, maybe you’ll want to &lt;a href=&quot;https://realpython.com/flask-database/&quot;&gt;add a database&lt;/a&gt; or implement &lt;a href=&quot;https://realpython.com/flask-logging-messages/&quot;&gt;logging and notification messages&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;get-started&quot;&gt;Get Started&lt;a class=&quot;headerlink&quot; href=&quot;#get-started&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this section, you’ll prepare the development environment for your Flask project. First, you’ll create a &lt;strong&gt;virtual environment&lt;/strong&gt; and install all the &lt;strong&gt;dependencies&lt;/strong&gt; that you need for your project.&lt;/p&gt;
&lt;h3 id=&quot;create-a-virtual-environment&quot;&gt;Create a Virtual Environment&lt;a class=&quot;headerlink&quot; href=&quot;#create-a-virtual-environment&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In this section, you’ll build your project structure. You can name the root folder of your project any way you like. For example, you could name it &lt;code&gt;rp_flask_board/&lt;/code&gt; if your ultimate goal is to create a message board. If you have another project in mind, then feel free to name your folder accordingly. Create your folder and navigate into it:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;mkdir&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;rp_flask_board
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;rp_flask_board
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this case, you name the root folder of your project &lt;code&gt;rp_flask_board/&lt;/code&gt;. The files and folders that you create over the course of this series will be located in either this folder or its subfolders.&lt;/p&gt;
&lt;p&gt;After you navigate to the project folder, it’s a good idea to create and activate a &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt;. That way, you’re installing any project dependencies not system-wide but only in your project’s virtual environment.&lt;/p&gt;
&lt;p&gt;Select your &lt;strong&gt;operating system&lt;/strong&gt; below and use your platform-specific command to set up a virtual environment:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-windows&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body active small&quot; id=&quot;windows-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#windows-1&quot; role=&quot;tab&quot; aria-controls=&quot;windows-1&quot; aria-selected=&quot;true&quot;&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#brands--windows&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Windows&lt;/a&gt;
  &lt;/li&gt;




  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-linuxmacos&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body small&quot; id=&quot;macos-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#linux-macos-1&quot; role=&quot;tab&quot; aria-controls=&quot;linux-macos-1&quot; aria-selected=&quot;false&quot;&gt;&lt;span class=&quot;icon baseline text-muted&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#v4--linux&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#v4--apple&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Linux + macOS&lt;/a&gt;
  &lt;/li&gt;

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-1&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;python&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;venv&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;venv&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;venv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Scripts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;activate&lt;/span&gt;
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;PS&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-1&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;venv&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;venv
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &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;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With the commands shown above, you create and activate a virtual environment named &lt;code&gt;venv&lt;/code&gt; by using Python’s built-in &lt;code&gt;venv&lt;/code&gt; module. The parenthesized &lt;code&gt;(venv)&lt;/code&gt; in front of the prompt indicates that you’ve successfully activated the virtual environment.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/flask-project/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/flask-project/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Basics Exercises: Strings and String Methods</title>
      <id>https://realpython.com/courses/python-exercises-string-methods/</id>
      <link href="https://realpython.com/courses/python-exercises-string-methods/"/>
      <updated>2023-12-12T14:00:00+00:00</updated>
      <summary>In this Python Basics Exercises course, you&#x27;ll review how to work with the string data type. You&#x27;ll practice manipulating strings with methods and formatting them for printing.</summary>
      <content type="html">
        &lt;p&gt;In &lt;a href=&quot;https://realpython.com/courses/python-basics-strings-string-methods/&quot;&gt;Python Basics: Strings and String Methods&lt;/a&gt;,
you used &lt;strong&gt;strings&lt;/strong&gt; for text data in Python. You also learned how to manipulate strings with &lt;strong&gt;string methods&lt;/strong&gt;.
For example, you changed strings from lowercase to uppercase, 
removed whitespace from the beginning or end of a string, and replaced
parts of a string with different text.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll practice:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Manipulating strings with &lt;strong&gt;string methods&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Working with &lt;strong&gt;user input&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Dealing with strings of &lt;strong&gt;numbers&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Formatting&lt;/strong&gt; strings for printing&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course. If you&amp;rsquo;re just getting started, then you might want to check out &lt;a href=&quot;https://realpython.com/courses/setting-up-python/&quot;&gt;Python Basics: Setting Up Python&lt;/a&gt; before diving into this course.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python News: What&#x27;s New From November 2023</title>
      <id>https://realpython.com/python-news-november-2023/</id>
      <link href="https://realpython.com/python-news-november-2023/"/>
      <updated>2023-12-11T14:00:00+00:00</updated>
      <summary>November 2023 was a busy month for Python, with PyPI&#x27;s first security audit and new versions of Pydantic and PyScript. There&#x27;s also still time to submit a proposal to PyCon US and to participate in the annual Python Developers Survey.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;November brought exciting news to the Python community, from PyPI’s first &lt;strong&gt;security audit&lt;/strong&gt; to a new version of &lt;strong&gt;PyScript&lt;/strong&gt;! The month also gave Python developers like you ample opportunities to get involved in the ecosystem through the annual &lt;strong&gt;Python Developers Survey&lt;/strong&gt; and the &lt;strong&gt;PyCon US&lt;/strong&gt; call for proposals. Development has also continued on &lt;strong&gt;Python 3.13&lt;/strong&gt; and &lt;strong&gt;Pydantic&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Get ready to explore the recent highlights!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;&lt;p&gt;&lt;strong&gt;Join Now:&lt;/strong&gt; &lt;a href=&quot;&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-newsletter&quot; data-focus=&quot;false&quot;&gt;Click here to join the Real Python Newsletter&lt;/a&gt; and you&#x27;ll never miss another Python tutorial, course update, or post.&lt;/p&gt;&lt;/div&gt;

&lt;h2 id=&quot;pypi-completes-first-security-audit&quot;&gt;PyPI Completes First Security Audit&lt;a class=&quot;headerlink&quot; href=&quot;#pypi-completes-first-security-audit&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;With the support of the &lt;a href=&quot;https://www.opentech.fund/&quot;&gt;Open Technology Fund (OTF)&lt;/a&gt;, the &lt;a href=&quot;https://pypi.org/&quot;&gt;Python Package Index (PyPI)&lt;/a&gt; completed its &lt;a href=&quot;https://blog.pypi.org/posts/2023-11-14-1-pypi-completes-first-security-audit/&quot;&gt;first external security audit&lt;/a&gt; in November. Because PyPI is the official index and repository for the Python ecosystem, maintaining its security is of vital importance for the community at large.&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; PyPI has been doing a lot to boost security recently, including hiring a safety and security engineer. You can hear from him on &lt;a href=&quot;https://realpython.com/podcasts/rpp/177/&quot;&gt;The Real Python Podcast Episode 177: Welcoming PyPI’s Safety &amp;amp; Security Engineer Mike Fiedler&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The audit began in late summer 2023 and involved searching for security vulnerabilities in &lt;a href=&quot;https://github.com/pypi/warehouse&quot;&gt;Warehouse&lt;/a&gt; and &lt;a href=&quot;https://github.com/cabotage/cabotage-app&quot;&gt;cabotage&lt;/a&gt;, the codebases that power and deploy PyPI. &lt;a href=&quot;https://www.trailofbits.com/&quot;&gt;Trail of Bits&lt;/a&gt;, a security firm with significant open-source and Python experience, performed the audit.&lt;/p&gt;
&lt;p&gt;Overall, the auditors didn’t identify any high-severity issues in either of the codebases, which is great news. The audit did flag some issues, like weak signature verification, unintentional information leaks, and weak cryptographic hashes, but but ultimately noted that the codebases demonstrated best practices in the industry. The PyPI team has already made the repository safer by working to remediate the risks that came up in the audit.&lt;/p&gt;
&lt;p&gt;If you’d like to learn more about how Trail of Bits conducted the audit and what the team found, then check out &lt;a href=&quot;https://blog.trailofbits.com/2023/11/14/our-audit-of-pypi/&quot;&gt;the blog post&lt;/a&gt; on the audit. You can also read the &lt;a href=&quot;https://github.com/trailofbits/publications#technology-product-reviews&quot;&gt;full report&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;python-3130a2-released&quot;&gt;Python 3.13.0a2 Released&lt;a class=&quot;headerlink&quot; href=&quot;#python-3130a2-released&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Just over a month ago, Python 3.12 introduced a ton of &lt;a href=&quot;https://realpython.com/python312-new-features/&quot;&gt;cool new features&lt;/a&gt;. But work never stops, and now the second alpha version of &lt;a href=&quot;https://discuss.python.org/t/python-3-13-0-alpha-2/39379&quot;&gt;Python 3.13&lt;/a&gt; is available.&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 is an alpha release, which isn’t intended for production environments. Instead, alpha versions are useful for testing features and fixing bugs.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The most notable change for this release, compared to 3.12, is the elimination of many modules. Python 3.13 closes out a &lt;a href=&quot;https://peps.python.org/pep-0594/#deprecation-schedule&quot;&gt;deprecation schedule&lt;/a&gt; that began in &lt;a href=&quot;https://realpython.com/python311-new-features/&quot;&gt;Python 3.11&lt;/a&gt; with &lt;a href=&quot;https://peps.python.org/pep-0594/&quot;&gt;PEP 594&lt;/a&gt;. If you’ve been using these &lt;a href=&quot;https://peps.python.org/pep-0594/#deprecated-modules&quot;&gt;deprecated modules&lt;/a&gt; on newer Python versions, then you’ve likely run into a &lt;code&gt;DeprecationWarning&lt;/code&gt;. Some of the modules eliminated are &lt;code&gt;aifc&lt;/code&gt;, &lt;code&gt;audioop&lt;/code&gt;, &lt;code&gt;cgi&lt;/code&gt;, &lt;code&gt;cgitb&lt;/code&gt;, &lt;code&gt;crypt&lt;/code&gt;, &lt;code&gt;pipes&lt;/code&gt;, &lt;code&gt;telnetlib&lt;/code&gt;, and &lt;code&gt;lib2to3&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;But Python 3.13 isn’t just about deprecation. It also adds improvements to some modules. Here are a few examples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In &lt;a href=&quot;https://realpython.com/async-io-python/&quot;&gt;&lt;code&gt;asyncio&lt;/code&gt;&lt;/a&gt;, the &lt;code&gt;asyncio.loop.create_unix_server()&lt;/code&gt; method will now automatically remove the Unix &lt;a href=&quot;https://realpython.com/python-sockets/&quot;&gt;socket&lt;/a&gt; when the connection to the server is closed, which means you won’t have an unnecessary socket file hanging around on disk. &lt;/li&gt;
&lt;li&gt;In the &lt;code&gt;copy&lt;/code&gt; module, &lt;code&gt;copy.replace()&lt;/code&gt; makes working with &lt;a href=&quot;https://realpython.com/python-mutable-vs-immutable-types/&quot;&gt;immutable&lt;/a&gt; objects more convenient by allowing you to create a modified copy. &lt;/li&gt;
&lt;li&gt;In the &lt;code&gt;ipaddress&lt;/code&gt; module, the new &lt;code&gt;ipaddress.IPV4Address.ipv6_mapped&lt;/code&gt; property lets you represent an IPv4 address as an IPv6 address.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is just a small sampling of the new functionality added to this version. To see the full list of removals, deprecations, additions, and improvements in 3.13.0a2, check out &lt;a href=&quot;https://docs.python.org/dev/whatsnew/3.13.html&quot;&gt;What’s New In Python 3.13&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-news-november-2023/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-news-november-2023/ »&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 #183: Exploring Code Reviews in Python and Automating the Process</title>
      <id>https://realpython.com/podcasts/rpp/183/</id>
      <link href="https://realpython.com/podcasts/rpp/183/"/>
      <updated>2023-12-08T12:00:00+00:00</updated>
      <summary>What goes into a code review in Python? Is there a difference in how a large organization practices code review compared to a smaller one? What do you do if you&#x27;re a solo developer? This week on the show, Brendan Maginnis and Nick Thapen from Sourcery return to talk about code review and automated code assistance.</summary>
      <content type="html">
        &lt;p&gt;What goes into a code review in Python? Is there a difference in how a large organization practices code review compared to a smaller one? What do you do if you&#x27;re a solo developer? This week on the show, Brendan Maginnis and Nick Thapen from Sourcery return to talk about code review and automated code assistance.&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>Build a Hangman Game With Python and PySimpleGUI</title>
      <id>https://realpython.com/hangman-python-pysimplegui/</id>
      <link href="https://realpython.com/hangman-python-pysimplegui/"/>
      <updated>2023-12-06T14:00:00+00:00</updated>
      <summary>In this step-by-step tutorial, you&#x27;ll learn how to write the game of hangman in Python with a PySimpleGUI-based interface. You&#x27;ll see how to structure the game, build its GUI, and program the game&#x27;s logic and rules.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Wouldn’t it be cool to build a &lt;a href=&quot;https://en.wikipedia.org/wiki/Hangman_(game)&quot;&gt;hangman&lt;/a&gt; game with a nice graphical user interface (GUI) in Python? Maybe you’ve built a text-based user interface version of &lt;a href=&quot;https://realpython.com/python-hangman/&quot;&gt;hangman&lt;/a&gt;, and now you want to make an even more attractive game. For you as a Python programmer, building a GUI version of this game can be a rewarding challenge that can take you to the next skill level.&lt;/p&gt;
&lt;p&gt;Throughout this tutorial, you’ll build the hangman game in Python in a series of steps. The game will have a neat graphical interface based on the PySimpleGUI library.&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;Create a &lt;strong&gt;GUI&lt;/strong&gt; for your hangman game using &lt;strong&gt;PySimpleGUI&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Implement the &lt;strong&gt;logic&lt;/strong&gt; for the hangman game&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Connect&lt;/strong&gt; the game’s logic with its GUI layer&lt;/li&gt;
&lt;li&gt;Handle the &lt;strong&gt;game results&lt;/strong&gt; and provide other options&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most from this tutorial, you should be comfortable with general Python programming, including how to &lt;a href=&quot;https://realpython.com/python-application-layouts/&quot;&gt;lay out a project&lt;/a&gt;. You should also have some experience working with &lt;a href=&quot;https://realpython.com/python-pyqt-gui-calculator/&quot;&gt;graphical user interfaces&lt;/a&gt;, especially those based on &lt;a href=&quot;https://realpython.com/pysimplegui-python/&quot;&gt;PySimpleGUI&lt;/a&gt;. You don’t need to have any previous knowledge about &lt;a href=&quot;https://realpython.com/pygame-a-primer/&quot;&gt;game&lt;/a&gt; programming, but it would be a plus.&lt;/p&gt;
&lt;p&gt;All the code that you’ll write in this tutorial is available for download. You can get it by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/hangman-python-pysimplegui-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-hangman-python-pysimplegui-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free Python source code&lt;/a&gt; for your PySimpleGUI hangman game.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;demo-hangman-with-python-and-pysimplegui&quot;&gt;Demo: Hangman With Python and PySimpleGUI&lt;a class=&quot;headerlink&quot; href=&quot;#demo-hangman-with-python-and-pysimplegui&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this tutorial, you’ll write an implementation of hangman using Python and PySimpleGUI. Once you’ve run all the steps to build the game, then you’ll end up with a &lt;a href=&quot;https://en.wikipedia.org/wiki/Graphical_user_interface&quot;&gt;graphical user interface (GUI)&lt;/a&gt; that will work something like the following:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 &quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/885183317?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/figure&gt;

&lt;p&gt;In this tutorial, you’ll run through several challenges designed to help you solve specific game-related problems. Ultimately, you’ll have a hangman game that works like the demo above.&lt;/p&gt;
&lt;h2 id=&quot;project-overview&quot;&gt;Project Overview&lt;a class=&quot;headerlink&quot; href=&quot;#project-overview&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When creating a GUI version of hangman, you’ll use a GUI framework that can handle a text-based game like hangman while still providing the ability to draw a hanged man. There are several good GUI engines available for Python. While you can use any of them to good effect, you’ll rely on PySimpleGUI in this tutorial.&lt;/p&gt;
&lt;p&gt;PySimpleGUI is a wrapper around several well-known GUI frameworks and libraries, such as &lt;a href=&quot;https://realpython.com/python-gui-tkinter/&quot;&gt;Tkinter&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-gui-with-wxpython/&quot;&gt;wxPython&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-pyqt-gui-calculator/&quot;&gt;PyQt&lt;/a&gt;. It allows you to design a GUI as data. You’ll use the &lt;a href=&quot;https://pypi.python.org/pypi/PySimpleGUI/&quot;&gt;Tkinter wrapper&lt;/a&gt; in this tutorial, but you can explore the &lt;a href=&quot;https://pypi.python.org/pypi/PySimpleGUIWx/&quot;&gt;wxPython&lt;/a&gt; and &lt;a href=&quot;https://pypi.python.org/pypi/PySimpleGUIQt/&quot;&gt;QT&lt;/a&gt; wrappers on &lt;a href=&quot;https://realpython.com/pypi-publish-python-package/&quot;&gt;PyPI&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;While many people know hangman well, it’s helpful to have a formal description of the game. You’ll use this description to resolve programming issues later during development. The game’s description could vary from person to person. In this tutorial, you’ll describe the game as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Game setup&lt;/strong&gt;: The game of hangman is for two or more players, comprising a &lt;strong&gt;selecting player&lt;/strong&gt; and one or more &lt;strong&gt;guessing players&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Word selection&lt;/strong&gt;: The selecting player selects a word that the guessing players will try to guess.&lt;ul&gt;
&lt;li&gt;The selected word is traditionally represented as a series of underscores for each letter in the word.&lt;/li&gt;
&lt;li&gt;The selecting player also draws a scaffold to hold the hangman illustration.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Guessing&lt;/strong&gt;: The guessing players attempt to guess the word by selecting letters one at a time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Feedback&lt;/strong&gt;: The selecting player indicates whether each guessed letter appears in the word.&lt;ul&gt;
&lt;li&gt;If the letter appears, then the selecting player replaces each underscore with the letter as it appears in the word.&lt;/li&gt;
&lt;li&gt;If the letter doesn’t appear, then the selecting player writes the letter in a list of guessed letters. Then, they draw the next piece of the hanged man. To draw the hanged man, they begin with the head, then the torso, the arms, and the legs for a total of six parts.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Winning conditions&lt;/strong&gt;: The selecting player wins if the hanged man drawing is complete after six incorrect guesses, in which case the game is over. The guessing players win if they guess the word.&lt;ul&gt;
&lt;li&gt;If the guess is right, the game is over, and the guessing players win.&lt;/li&gt;
&lt;li&gt;If the guess is wrong, the game continues.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A game in progress is shown below. In this game, the word is &lt;em&gt;hangman&lt;/em&gt;:&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/Hangman_CLI_-_page_22.2b446e354404.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-66&quot; src=&quot;https://files.realpython.com/media/Hangman_CLI_-_page_22.2b446e354404.png&quot; width=&quot;1000&quot; height=&quot;1350&quot; srcset=&quot;https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Hangman_CLI_-_page_22.2b446e354404.png&amp;amp;w=250&amp;amp;sig=430e659223daa02cf6f239f44419e96f90890bd8 250w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Hangman_CLI_-_page_22.2b446e354404.png&amp;amp;w=333&amp;amp;sig=6f84d2eb1a83d96259ffe306bef461078240815b 333w, https://robocrop.realpython.net/?url=https%3A//files.realpython.com/media/Hangman_CLI_-_page_22.2b446e354404.png&amp;amp;w=500&amp;amp;sig=0cbbe4bcb2a612d2833bc4106cf8e9cc8eaf4e9f 500w, https://files.realpython.com/media/Hangman_CLI_-_page_22.2b446e354404.png 1000w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;A game of hangman in progress&quot; data-asset=&quot;2977&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;In this tutorial, you’ll make a few additional design decisions while writing the hangman game in Python:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The game will be between the &lt;strong&gt;computer&lt;/strong&gt; and &lt;strong&gt;one human player&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;computer&lt;/strong&gt; will act as the selecting player and will &lt;strong&gt;select&lt;/strong&gt; the word to guess, &lt;strong&gt;process&lt;/strong&gt; human input, and &lt;strong&gt;handle&lt;/strong&gt; all output.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;human&lt;/strong&gt; player is the &lt;strong&gt;guessing player&lt;/strong&gt;, hereafter simply referred to as the &lt;em&gt;player&lt;/em&gt;. When the player knows the word, they continue to guess correct letters until the word is complete.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With this basic understanding of the game and some design decisions for the computer version, you can begin creating the game. First, however, you need to be aware of some knowledge requirements.&lt;/p&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;headerlink&quot; href=&quot;#prerequisites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The project that that you’ll build in this tutorial will require familiarity with general Python programming. You should have basic knowledge of the following topics:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Creating GUI apps with &lt;a href=&quot;https://realpython.com/pysimplegui-python/&quot;&gt;PySimpleGUI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Working with &lt;a href=&quot;https://realpython.com/working-with-files-in-python/&quot;&gt;files&lt;/a&gt; and the &lt;a href=&quot;https://realpython.com/python-with-statement/&quot;&gt;&lt;code&gt;with&lt;/code&gt; statement&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Defining your own &lt;a href=&quot;https://realpython.com/python-classes/&quot;&gt;classes&lt;/a&gt; and working with &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Writing &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;&lt;code&gt;for&lt;/code&gt;&lt;/a&gt; loops, &lt;a href=&quot;https://realpython.com/python-while-loop/&quot;&gt;&lt;code&gt;while&lt;/code&gt;&lt;/a&gt; loops, and &lt;a href=&quot;https://realpython.com/list-comprehension-python/&quot;&gt;comprehensions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Working with &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;conditional statements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Working with Python &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;strings&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-list/&quot;&gt;lists&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-sets/&quot;&gt;sets&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However, if you don’t have all this knowledge yet, then that’s okay! You might learn more by going ahead and giving the project a shot. You can always stop and review the resources linked here if you get stuck.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/hangman-python-pysimplegui/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/hangman-python-pysimplegui/ »&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>How to Get the Current Time in Python</title>
      <id>https://realpython.com/courses/python-get-current-time/</id>
      <link href="https://realpython.com/courses/python-get-current-time/"/>
      <updated>2023-12-05T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll be getting the current time in Python. You&#x27;ll get your hands on a datetime object that represents the current time. You&#x27;ll see how to format it according to international standards, and you&#x27;ll even check out how computers represent time.</summary>
      <content type="html">
        &lt;p&gt;Getting the &lt;strong&gt;current time&lt;/strong&gt; in Python is a nice starting point for many time-related operations. One very important use case is creating &lt;a href=&quot;https://en.wikipedia.org/wiki/Timestamp&quot;&gt;timestamps&lt;/a&gt;. In this tutorial, you&amp;rsquo;ll learn how to &lt;strong&gt;get&lt;/strong&gt;, &lt;strong&gt;display&lt;/strong&gt;, and &lt;strong&gt;format&lt;/strong&gt; the current time with the &lt;a href=&quot;https://docs.python.org/3/library/datetime.html&quot;&gt;&lt;code&gt;datetime&lt;/code&gt;&lt;/a&gt; module.&lt;/p&gt;
&lt;p&gt;To effectively use the current time in your Python applications, you&amp;rsquo;ll add a few tools to your belt. For instance, you&amp;rsquo;ll learn how to &lt;strong&gt;read attributes&lt;/strong&gt; of the current time, like the year, minutes, or seconds. To make the time more easily readable, you&amp;rsquo;ll explore options for &lt;strong&gt;printing&lt;/strong&gt; it. You&amp;rsquo;ll also get to know different &lt;strong&gt;formats&lt;/strong&gt; of time and understand how to deal with &lt;strong&gt;time zones&lt;/strong&gt;.&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>Serialize Your Data With Python</title>
      <id>https://realpython.com/python-serialize-data/</id>
      <link href="https://realpython.com/python-serialize-data/"/>
      <updated>2023-12-04T14:00:00+00:00</updated>
      <summary>In this in-depth tutorial, you&#x27;ll explore the world of data serialization in Python. You&#x27;ll compare and use different data serialization formats, serialize Python objects and executable code, and handle HTTP message payloads.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Whether you’re a data scientist crunching &lt;strong&gt;big data&lt;/strong&gt; in a distributed cluster, a back-end engineer building scalable &lt;strong&gt;microservices&lt;/strong&gt;, or a front-end developer consuming &lt;strong&gt;web APIs&lt;/strong&gt;, you should understand data serialization. In this comprehensive guide, you’ll move beyond XML and JSON to explore several data formats that you can use to serialize data in Python. You’ll explore them based on their use cases, learning about their distinct categories.&lt;/p&gt;
&lt;p&gt;By the end of this tutorial, you’ll have a deep understanding of the many data interchange formats available. You’ll master the ability to persist and transfer stateful objects, effectively making them immortal and transportable through time and space. Finally, you’ll learn to send executable code over the network, unlocking the potential of remote computation and distributed processing.&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;Choose a suitable &lt;strong&gt;data serialization format&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Take snapshots of &lt;strong&gt;stateful Python objects&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Send &lt;strong&gt;executable code&lt;/strong&gt; over the wire for &lt;strong&gt;distributed processing&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Adopt popular data formats for &lt;strong&gt;HTTP message payloads&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Serialize &lt;strong&gt;hierarchical&lt;/strong&gt;, &lt;strong&gt;tabular&lt;/strong&gt;, and other &lt;strong&gt;shapes of data&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Employ &lt;strong&gt;schemas&lt;/strong&gt; for validating and evolving the structure of data&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, you should have a good understanding of &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt; principles, including &lt;a href=&quot;https://realpython.com/python-classes/&quot;&gt;classes&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-data-classes/&quot;&gt;data classes&lt;/a&gt;, as well as &lt;a href=&quot;https://realpython.com/python-type-checking/&quot;&gt;type hinting&lt;/a&gt; in Python. Additionally, familiarity with the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/HTTP&quot;&gt;HTTP protocol&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/learning-paths/become-python-web-developer/&quot;&gt;Python web frameworks&lt;/a&gt; would be a plus. This knowledge will make it easier for you to follow along with the tutorial.&lt;/p&gt;
&lt;p&gt;You can download all the code samples accompanying this tutorial by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-serialize-data-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-serialize-data-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to serialize your data with Python.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Feel free to skip ahead and focus on the part that interests you the most, or buckle up and get ready to catapult your data management skills to a whole new level!&lt;/p&gt;
&lt;h2 id=&quot;get-an-overview-of-data-serialization&quot;&gt;Get an Overview of Data Serialization&lt;a class=&quot;headerlink&quot; href=&quot;#get-an-overview-of-data-serialization&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Serialization&lt;/strong&gt;, also known as &lt;strong&gt;marshaling&lt;/strong&gt;, is the process of translating a piece of data into an interim representation that’s suitable for &lt;a href=&quot;https://en.wikipedia.org/wiki/Data_communication&quot;&gt;transmission&lt;/a&gt; through a network or &lt;a href=&quot;https://en.wikipedia.org/wiki/Persistence_(computer_science)&quot;&gt;persistent storage&lt;/a&gt; on a medium like an optical disk. Because the serialized form isn’t useful on its own, you’ll eventually want to restore the original data. The inverse operation, which can occur on a remote machine, is called &lt;strong&gt;deserialization&lt;/strong&gt; or &lt;strong&gt;unmarshaling&lt;/strong&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; Although the terms &lt;a href=&quot;https://en.wikipedia.org/wiki/Serialization&quot;&gt;serialization&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Marshalling_(computer_science)&quot;&gt;marshaling&lt;/a&gt; are often used interchangeably, they can have slightly different meanings for different people. In some circles, serialization is only concerned with the translation part, while marshaling is also about moving data from one place to another.&lt;/p&gt;
&lt;p&gt;The precise meaning of each term depends on whom you ask. For example, Java programmers tend to use the word &lt;em&gt;marshaling&lt;/em&gt; in the context of &lt;a href=&quot;https://en.wikipedia.org/wiki/Java_remote_method_invocation&quot;&gt;remote method invocation (RMI)&lt;/a&gt;. In Python, marshaling refers almost exclusively to the format used for storing the compiled &lt;a href=&quot;https://en.wikipedia.org/wiki/Bytecode&quot;&gt;bytecode&lt;/a&gt; instructions.&lt;/p&gt;
&lt;p&gt;Check out the &lt;a href=&quot;https://en.wikipedia.org/wiki/Marshalling_(computer_science)#Comparison_with_serialization&quot;&gt;comparison of serialization and marshaling&lt;/a&gt; on Wikipedia for more details.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The name &lt;em&gt;serialization&lt;/em&gt; implies that your data, which may be structured as a dense graph of objects in the computer’s memory, becomes a linear sequence—or a &lt;strong&gt;series&lt;/strong&gt;—of &lt;a href=&quot;https://en.wikipedia.org/wiki/Byte&quot;&gt;bytes&lt;/a&gt;. Such a linear representation is perfect to transmit or store. Raw bytes are universally understood by various programming languages, operating systems, and hardware architectures, making it possible to exchange data between otherwise incompatible systems.&lt;/p&gt;
&lt;p&gt;When you visit an online store using your web browser, chances are it runs a piece of &lt;a href=&quot;https://realpython.com/python-vs-javascript/&quot;&gt;JavaScript&lt;/a&gt; code in the background to communicate with a back-end system. That back end might be implemented in &lt;a href=&quot;https://realpython.com/learning-paths/flask-by-example/&quot;&gt;Flask&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/learning-paths/django-web-development/&quot;&gt;Django&lt;/a&gt;, or &lt;a href=&quot;https://realpython.com/fastapi-python-web-apis/&quot;&gt;FastAPI&lt;/a&gt;, which are Python web frameworks. Because JavaScript and Python are two different languages with distinct syntax and data types, they must share information using an interchange format that both sides can understand.&lt;/p&gt;
&lt;p&gt;In other words, parties on opposite ends of a digital conversation may deserialize the same piece of information into wildly different internal representations due to their technical constraints and specifications. However, it would still be the same information from a semantic point of view.&lt;/p&gt;
&lt;p&gt;Tools like &lt;a href=&quot;https://nodejs.org/en&quot;&gt;Node.js&lt;/a&gt; make it possible to run JavaScript on the back end, including &lt;a href=&quot;https://en.wikipedia.org/wiki/Isomorphic_JavaScript&quot;&gt;isomorphic JavaScript&lt;/a&gt; that can run on both the client and the server in an unmodified form. This eliminates language discrepancies altogether but doesn’t address more subtle nuances, such as &lt;a href=&quot;https://realpython.com/python-bitwise-operators/#big-endian-vs-little-endian&quot;&gt;big-endian vs little-endian&lt;/a&gt; differences in hardware.&lt;/p&gt;
&lt;p&gt;Other than that, transporting data from one machine to another still requires converting it into a network-friendly format. Specifically, the format should allow the sender to partition and put the data into &lt;a href=&quot;https://en.wikipedia.org/wiki/Network_packet&quot;&gt;network packets&lt;/a&gt;, which the receiving machine can later correctly reassemble. Network protocols are fairly low-level, so they deal with streams of bytes rather than high-level data types.&lt;/p&gt;
&lt;p&gt;Depending on your use case, you’ll want to pick a &lt;strong&gt;data serialization format&lt;/strong&gt; that offers the best trade-off between its pros and cons. In the next section, you’ll learn about various categories of data formats used in serialization. If you already have prior knowledge about these formats and would like to explore their respective scenarios, then feel free to skip the basic introduction coming up next.&lt;/p&gt;
&lt;h2 id=&quot;compare-data-serialization-formats&quot;&gt;Compare Data Serialization Formats&lt;a class=&quot;headerlink&quot; href=&quot;#compare-data-serialization-formats&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There are many ways to classify data serialization formats. Some of these categories aren’t mutually exclusive, making certain formats fall under a few of them simultaneously. In this section, you’ll find an overview of the different categories, their trade-offs, and use cases, as well as examples of popular data serialization formats.&lt;/p&gt;
&lt;p&gt;Later, you’ll get your hands on some practical applications of these data serialization formats under different programming scenarios. To follow along, download the sample code mentioned in the introduction and install the required dependencies from the included &lt;code&gt;requirements.txt&lt;/code&gt; file into an active &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt; by issuing the following command:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-r&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;requirements.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This will install several third-party libraries, frameworks, and tools that will allow you to navigate through the remaining part of this tutorial smoothly.&lt;/p&gt;
&lt;h3 id=&quot;textual-vs-binary&quot;&gt;Textual vs Binary&lt;a class=&quot;headerlink&quot; href=&quot;#textual-vs-binary&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;At the end of the day, all serialized data becomes a stream of bytes regardless of its original shape or form. But some byte values—or their specific arrangement—may correspond to &lt;a href=&quot;https://en.wikipedia.org/wiki/Code_point&quot;&gt;Unicode code points&lt;/a&gt; with a meaningful and human-readable representation. Data serialization formats whose syntax consists purely of characters visible to the naked eye are called &lt;strong&gt;textual data formats&lt;/strong&gt;, as opposed to &lt;strong&gt;binary data formats&lt;/strong&gt; meant for machines to read.&lt;/p&gt;
&lt;p&gt;The main benefit of a textual data format is that people like you can read serialized messages, make sense of them, and even edit them by hand when needed. In many cases, these data formats are self-explanatory, with descriptive element or attribute names. For example, take a look at this excerpt from the Real Python &lt;a href=&quot;https://en.wikipedia.org/wiki/Web_feed&quot;&gt;web feed&lt;/a&gt; with information about the latest tutorials and courses published:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-serialize-data/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-serialize-data/ »&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 #182: Building a Python JSON Parser &amp; Discussing Ideas for PEPs</title>
      <id>https://realpython.com/podcasts/rpp/182/</id>
      <link href="https://realpython.com/podcasts/rpp/182/"/>
      <updated>2023-12-01T12:00:00+00:00</updated>
      <summary>Have you thought of a way to improve the Python language? How do you share your idea with core developers and start a discussion in the Python community? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you thought of a way to improve the Python language? How do you share your idea with core developers and start a discussion in the Python community? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Single and Double Underscores in Python Names</title>
      <id>https://realpython.com/python-double-underscore/</id>
      <link href="https://realpython.com/python-double-underscore/"/>
      <updated>2023-11-29T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn a few Python naming conventions involving single and double underscores (_). You&#x27;ll learn how to use this character to differentiate between public and non-public names in APIs, write safe classes for subclassing purposes, avoid name clashes, and more.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python has a few important &lt;strong&gt;naming conventions&lt;/strong&gt; that are based on using either a single or double &lt;strong&gt;underscore&lt;/strong&gt; character (&lt;code&gt;_&lt;/code&gt;). These conventions allow you to differentiate between public and non-public names in APIs, write safe classes for subclassing purposes, avoid name clashes, and more.&lt;/p&gt;
&lt;p&gt;Following and respecting these conventions allows you to write code that looks Pythonic and consistent in the eyes of other Python developers. This skill is especially useful when you’re writing code that’s intended for other developers to work with.&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;Learn about Python &lt;strong&gt;naming conventions&lt;/strong&gt; that rely on using &lt;strong&gt;underscores&lt;/strong&gt; (&lt;code&gt;_&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Differentiate &lt;strong&gt;public&lt;/strong&gt; and &lt;strong&gt;non-public&lt;/strong&gt; names by using a single leading underscore&lt;/li&gt;
&lt;li&gt;Use double leading underscores to leverage &lt;strong&gt;name mangling&lt;/strong&gt; in Python classes&lt;/li&gt;
&lt;li&gt;Explore other &lt;strong&gt;common uses&lt;/strong&gt; of underscores in Python names&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, you should be familiar with Python &lt;a href=&quot;https://realpython.com/python-use-global-variable-in-function/&quot;&gt;variables&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-constants/&quot;&gt;constants&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;functions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-modules-packages/&quot;&gt;modules&lt;/a&gt;, and especially &lt;a href=&quot;https://realpython.com/python-classes/&quot;&gt;classes&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-double-underscore-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-double-underscore-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to use single and double underscores in Python names.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;public-interfaces-and-naming-conventions-in-python&quot;&gt;Public Interfaces and Naming Conventions in Python&lt;a class=&quot;headerlink&quot; href=&quot;#public-interfaces-and-naming-conventions-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;As a Python programmer, you’ll frequently work with &lt;strong&gt;public interfaces&lt;/strong&gt;, or &lt;a href=&quot;https://en.wikipedia.org/wiki/API&quot;&gt;application programming interfaces (API)&lt;/a&gt;. An API is a type of programming interface that offers a service to other parts of a program or other programs.&lt;/p&gt;
&lt;p&gt;For example, the Python &lt;a href=&quot;https://docs.python.org/3/library/index.html&quot;&gt;standard library&lt;/a&gt; has many &lt;a href=&quot;https://realpython.com/python-modules-packages/&quot;&gt;modules and packages&lt;/a&gt; that provide certain services. To use these modules and packages, you need to access their &lt;em&gt;public&lt;/em&gt; components, such as classes, functions, variables, constants, and modules. All these objects are part of the module or package’s public interface. They’re available for you to use directly in your code.&lt;/p&gt;
&lt;p&gt;However, many of these packages and modules define objects that aren’t intended for direct access. These objects are for the internal use of the specific package or module only. They’re not part of its public interface.&lt;/p&gt;
&lt;p&gt;In the context of &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt;, languages like &lt;a href=&quot;https://realpython.com/python-vs-cpp/&quot;&gt;C++&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/java-vs-python/&quot;&gt;Java&lt;/a&gt; have the notion of &lt;strong&gt;public&lt;/strong&gt; and &lt;strong&gt;private&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/python-classes/#providing-behavior-with-methods&quot;&gt;methods&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-classes/#attaching-data-to-classes-and-instances&quot;&gt;attributes&lt;/a&gt;. In these languages, you can use these types of class members as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Public&lt;/strong&gt;: You can use them in your own code or client code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Private&lt;/strong&gt;: You can use them only from inside the defining class and its subclasses.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These languages have specific keywords and syntax to define public and private members in their classes. Once you declare a member as private, you can’t use it outside the class because the language restricts access. So, private members aren’t part of the class’s public interface, and there’s no way to access them.&lt;/p&gt;
&lt;p&gt;In contrast, Python doesn’t have the notion of public and private members. It has neither dedicated &lt;a href=&quot;https://realpython.com/python-keywords/&quot;&gt;keywords&lt;/a&gt; nor syntax for defining them. So, you can always access the members of a Python class.&lt;/p&gt;
&lt;p&gt;If Python doesn’t have a specific syntax to define when an object is part of a public interface, then how do you tell your users that they &lt;em&gt;can&lt;/em&gt; or &lt;em&gt;can’t&lt;/em&gt; use a given class, method, function, variable, constant, or even module in their code?&lt;/p&gt;
&lt;p&gt;To approach this question, the Python community has well-established &lt;strong&gt;naming conventions&lt;/strong&gt;. You should observe these naming conventions to explicitly indicate whether other developers should directly use your variables, constants, functions, methods, and modules in external code.&lt;/p&gt;
&lt;p&gt;Note that the naming conventions don’t restrict access to objects. They’re just a warning to other developers using your code. Because of this, Python doesn’t use the terms public and private. Instead, it uses the terms &lt;strong&gt;public&lt;/strong&gt; and &lt;strong&gt;non-public&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In Python, if a name starts with a letter in uppercase or lowercase, then you should consider that name public and, therefore, part of the code’s API. In contrast, if a name starts with an underscore character (&lt;code&gt;_&lt;/code&gt;), then you should consider that name non-public, meaning it’s not a part of the code’s API.&lt;/p&gt;
&lt;p&gt;The Python community uses the underscore character (&lt;code&gt;_&lt;/code&gt;) as part of other naming conventions. Here’s a summary of what &lt;a href=&quot;https://peps.python.org/pep-0008/&quot;&gt;PEP 8&lt;/a&gt; says about using this character in names:&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;Convention&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Single leading underscore&lt;/td&gt;
&lt;td&gt;&lt;code&gt;_variable&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates that the name is meant for internal use only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Single trailing underscore&lt;/td&gt;
&lt;td&gt;&lt;code&gt;class_&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Avoids naming conflicts with Python keywords and built-in names&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Double leading underscore&lt;/td&gt;
&lt;td&gt;&lt;code&gt;__attribute&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Triggers name mangling in the context of Python classes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Double leading and trailing underscore&lt;/td&gt;
&lt;td&gt;&lt;code&gt;__name__&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates special attributes and methods that Python provides&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Single underscore&lt;/td&gt;
&lt;td&gt;&lt;code&gt;_&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Indicates a temporary or throwaway variable&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Note that only two of these conventions enforce specific Python behaviors. Using double leading underscores triggers &lt;a href=&quot;https://realpython.com/python-pep8/#naming-conventions&quot;&gt;name mangling&lt;/a&gt; in Python classes. You’ll learn more about this behavior in the section on &lt;a href=&quot;#double-leading-underscore-in-classes-pythons-name-mangling&quot;&gt;name mangling&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Additionally, those names with double leading and trailing underscores that are listed in the Python &lt;a href=&quot;https://docs.python.org/3/reference/datamodel.html&quot;&gt;data model&lt;/a&gt; trigger internal behaviors in specific contexts. You’ll also learn more about this topic in the section on &lt;a href=&quot;#dunder-names-in-python&quot;&gt;dunder names in Python&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Python gives special treatment to the single underscore (&lt;code&gt;_&lt;/code&gt;), but only within &lt;code&gt;match&lt;/code&gt; … &lt;code&gt;case&lt;/code&gt; statements. You’ll learn more about this &lt;a href=&quot;#other-usages-of-underscores-in-python&quot;&gt;later&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;In the following section, you’ll learn more about using a single leading underscore when naming your Python objects.&lt;/p&gt;
&lt;h2 id=&quot;single-leading-underscore-in-python-names&quot;&gt;Single Leading Underscore in Python Names&lt;a class=&quot;headerlink&quot; href=&quot;#single-leading-underscore-in-python-names&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-double-underscore/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-double-underscore/ »&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>Advent of Code: Solving Puzzles With Python</title>
      <id>https://realpython.com/courses/python-advent-of-code/</id>
      <link href="https://realpython.com/courses/python-advent-of-code/"/>
      <updated>2023-11-28T14:00:00+00:00</updated>
      <summary>Advent of Code is an online advent calendar that shares new programming puzzles each day from December 1 to the 25. In this Code Conversation, you&#x27;ll learn why solving programming puzzles can be beneficial and how you can get started with Advent of Code using Python.</summary>
      <content type="html">
        &lt;p&gt;Advent of Code is an online Advent calendar where you&amp;rsquo;ll find new programming puzzles offered each day from December 1 to 25. While you can solve the puzzles at any time, the excitement when new puzzles unlock is really something special. You can participate in Advent of Code in any programming language&amp;mdash;including Python!&lt;/p&gt;
&lt;p&gt;With the help of this Code Conversation, you&amp;rsquo;ll be ready to start solving puzzles and earning your first gold stars.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What an &lt;strong&gt;online Advent calendar&lt;/strong&gt; is&lt;/li&gt;
&lt;li&gt;How solving puzzles can &lt;strong&gt;advance your programming skills&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How you can &lt;strong&gt;participate&lt;/strong&gt; in Advent of Code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Advent of Code puzzles are designed to be approachable by anyone with an interest in problem-solving. You don&amp;rsquo;t need a heavy computer science background to participate. Instead, Advent of Code is a great arena for learning new skills and testing out new features of Python.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Python Rich Package: Unleash the Power of Console Text</title>
      <id>https://realpython.com/python-rich-package/</id>
      <link href="https://realpython.com/python-rich-package/"/>
      <updated>2023-11-27T14:00:00+00:00</updated>
      <summary>Rich is a powerful library for constructing text-based user interfaces (TUIs) using Python. With it, you can make your code more readable by pretty-printing complex data structures, and you can make your app more attractive for your user with colored and formatted text, tables, animations, and more.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python’s Rich package is a tool kit that helps you generate beautifully formatted and highlighted text in the console.
More broadly, it allows you to build an attractive text-based user interface (TUI).&lt;/p&gt;
&lt;p&gt;Why would you choose a TUI over a graphical user interface, or GUI?
Sometimes a text display feels more appropriate. Why use a full-blown GUI for a simple application, when an elegant text interface will do? 
It can be refreshing to work with plain text. Text works in almost any hardware environment, even on an &lt;a href=&quot;https://en.wikipedia.org/wiki/Secure_Shell&quot;&gt;SSH&lt;/a&gt; terminal or a single-board computer display. And many applications don’t need the complexity of a full graphical windowing system.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn how Rich can help you:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enhance the &lt;strong&gt;user interface&lt;/strong&gt; of &lt;strong&gt;command-line tools&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Improve the readability of &lt;strong&gt;console output&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Create attractive &lt;strong&gt;dashboard displays&lt;/strong&gt; for real-time tabular data&lt;/li&gt;
&lt;li&gt;Generate &lt;strong&gt;well-formatted reports&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;https://realpython.com/interview-will-mcgugan/&quot;&gt;Will McGugan&lt;/a&gt;, the author of Rich, has also developed the &lt;a href=&quot;https://textual.textualize.io/&quot;&gt;Textual&lt;/a&gt; package. Whereas Rich is a rich-text tool kit, Textual is a full application framework built on Rich. It provides application base classes, an event-driven architecture, and more.&lt;/p&gt;
&lt;p&gt;There’s a lot you can do with Rich on its own, and its support for engaging, dynamic displays may well be sufficient for your app.
By following this tutorial, you’ll experiment with many of the cool features of Rich, and you’ll finish up by using your skills to build a dynamically scrolling tabular display of crypto prices:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 border&quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/877425433?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/figure&gt;

&lt;p&gt;To fully understand Rich’s syntax for animations, you should have a good grasp of &lt;a href=&quot;https://realpython.com/python-with-statement/&quot;&gt;context managers&lt;/a&gt;. But if you’re a bit rusty, don’t worry! You’ll get a quick refresher in this tutorial.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-rich-package-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-python-rich-package-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download free sample code&lt;/a&gt; that shows you how to use Rich for more beautiful Python code and apps.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;installing-rich&quot;&gt;Installing Rich&lt;a class=&quot;headerlink&quot; href=&quot;#installing-rich&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You can start using Rich very quickly. As always when starting a new project or investigation, it’s best to create a &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt; first, to avoid polluting your system’s Python installation.&lt;/p&gt;
&lt;p&gt;It’s quite possible to install Rich and use it with the built-in Python REPL, but for a better developer experience, you may want to include support for &lt;a href=&quot;https://realpython.com/jupyter-notebook-introduction/&quot;&gt;Jupyter notebooks&lt;/a&gt;. Here’s how you can install Rich so that it’ll work with either the REPL or Jupyter:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-windows&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body active small&quot; id=&quot;windows-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#windows-1&quot; role=&quot;tab&quot; aria-controls=&quot;windows-1&quot; aria-selected=&quot;true&quot;&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#brands--windows&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Windows&lt;/a&gt;
  &lt;/li&gt;




  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-linuxmacos&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body small&quot; id=&quot;macos-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#linux-macos-1&quot; role=&quot;tab&quot; aria-controls=&quot;linux-macos-1&quot; aria-selected=&quot;false&quot;&gt;&lt;span class=&quot;icon baseline text-muted&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#v4--linux&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#v4--apple&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Linux + macOS&lt;/a&gt;
  &lt;/li&gt;

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-1&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;python&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;venv&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;venv&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;venv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Scripts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;activate&lt;/span&gt;
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;python&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pip&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rich&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;[jupyter]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-1&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;venv&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;venv
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &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&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;rich[jupyter]&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Now that you’ve installed Rich in your new virtual environment, you can test it and also get a nice overview of its capabilities:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;rich
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Running this command will make lots of magic happen. Your terminal will fill with color, and you’ll see several options for customizing your text-based user interface:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 border&quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/877425502?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/figure&gt;

&lt;p&gt;Apart from displaying colorful text in a variety of styles, this demo also illustrates a few more of Rich’s exciting features.&lt;/p&gt;
&lt;p&gt;You can wrap and justify text. You can easily display any Unicode characters, as well as a wide choice of emojis. 
Rich renders Markdown and offers a syntax for creating elegantly formatted tables.&lt;/p&gt;
&lt;p&gt;There’s much more that you can do with Rich, as you’ll discover throughout this tutorial. You can also try some of the command-line demos that Rich has thoughtfully provided for its subpackages, so you can get a flavor of what each one can do without writing any code.&lt;/p&gt;
&lt;p&gt;Here are a few that you can try from your OS console. Execute them one by one to get a feel for the power of Rich:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;rich.table
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;rich.progress
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;rich.status
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Most of these demos are very short, but if necessary, you can always interrupt them with &lt;span class=&quot;keys&quot;&gt;&lt;kbd class=&quot;key-control&quot;&gt;Ctrl&lt;/kbd&gt;&lt;span&gt;+&lt;/span&gt;&lt;kbd class=&quot;key-c&quot;&gt;C&lt;/kbd&gt;&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;With the installation done, you’re ready to start exploring Rich.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-rich-package/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-rich-package/ »&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>Build Conway&#x27;s Game of Life With Python</title>
      <id>https://realpython.com/conway-game-of-life-python/</id>
      <link href="https://realpython.com/conway-game-of-life-python/"/>
      <updated>2023-11-22T14:00:00+00:00</updated>
      <summary>In this step-by-step project, you&#x27;ll implement Conway&#x27;s Game of Life in Python. To make the game usable, you&#x27;ll create a user-friendly command-line interface (CLI) with several options that will allow you to run the game using different life patterns and configurations.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Wouldn’t it be cool to build a Python game that only requires initial user input and then seems to take on a mind of its own, creating mesmerizing patterns along the way? You can do exactly that with &lt;a href=&quot;https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life&quot;&gt;Conway’s Game of Life&lt;/a&gt;, which is about the evolution of cells in a life grid.&lt;/p&gt;
&lt;p&gt;Implementing the Game of Life algorithm is a good exercise with many interesting challenges that you’ll have to figure out. Specifically, you’ll need to build the life grid and find a way to apply the game’s rules to all the cells on the grid so that they evolve through several generations.&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;Implement Conway’s &lt;strong&gt;Game of Life algorithm&lt;/strong&gt; with Python&lt;/li&gt;
&lt;li&gt;Build a &lt;strong&gt;&lt;code&gt;curses&lt;/code&gt; view&lt;/strong&gt; to display the Game of Life grid&lt;/li&gt;
&lt;li&gt;Create an &lt;strong&gt;&lt;code&gt;argparse&lt;/code&gt; command-line interface&lt;/strong&gt; for the game&lt;/li&gt;
&lt;li&gt;Set up the game app for &lt;strong&gt;installation&lt;/strong&gt; and &lt;strong&gt;execution&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get the most out of this tutorial, you should know the basics of writing &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented code&lt;/a&gt; in Python, creating command-line interface (CLI) apps with &lt;a href=&quot;https://realpython.com/command-line-interfaces-python-argparse/&quot;&gt;&lt;code&gt;argparse&lt;/code&gt;&lt;/a&gt;, and setting up a Python project.&lt;/p&gt;
&lt;p&gt;You can download the complete source code and other resources for this project by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/conway-game-of-life-python-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-conway-game-of-life-python-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the source code&lt;/a&gt; to build Conway’s Game of Life with Python.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;demo-conways-game-of-life-with-python&quot;&gt;Demo: Conway’s Game of Life With Python&lt;a class=&quot;headerlink&quot; href=&quot;#demo-conways-game-of-life-with-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this tutorial, you’ll implement &lt;strong&gt;Conway’s Game of Life&lt;/strong&gt; for your command line using Python. Once you’ve run all the steps to build the game, then you’ll end up with a fully working command-line app. &lt;/p&gt;
&lt;p&gt;The demo shows how the app works and walks you through the evolution of multiple life patterns or seeds, which define the game’s initial state and work as starting points for evolving the cells in the life grid:&lt;/p&gt;
&lt;figure&gt;
  &lt;div class=&quot;embed-responsive embed-responsive-16by9 rounded mb-3 &quot;&gt;
    &lt;iframe loading=&quot;lazy&quot; class=&quot;embed-responsive-item&quot; src=&quot;https://player.vimeo.com/video/875948923?background=1&quot; frameborder=&quot;0&quot; allow=&quot;fullscreen&quot; allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/figure&gt;

&lt;p&gt;Throughout this tutorial, you’ll run through several challenges related to the game’s algorithm and also to writing and setting up a command-line application in Python. At the end, you’ll have a Game of Life app that will work like the demo above.&lt;/p&gt;
&lt;h2 id=&quot;project-overview&quot;&gt;Project Overview&lt;a class=&quot;headerlink&quot; href=&quot;#project-overview&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;Game of Life&lt;/strong&gt; by the British mathematician &lt;a href=&quot;https://en.wikipedia.org/wiki/John_Horton_Conway&quot;&gt;John Horton Conway&lt;/a&gt; isn’t a game in the traditional sense. In technical terms, it’s a &lt;a href=&quot;https://en.wikipedia.org/wiki/Cellular_automaton&quot;&gt;cellular automaton&lt;/a&gt;, but you can think of Game of Life as a &lt;strong&gt;simulation&lt;/strong&gt; whose evolution depends on its initial state and doesn’t require further input from any players.&lt;/p&gt;
&lt;p&gt;The game’s board is an infinite, two-dimensional &lt;strong&gt;grid&lt;/strong&gt; of &lt;strong&gt;cells&lt;/strong&gt;. Each cell can be in one of two possible states:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Alive&lt;/li&gt;
&lt;li&gt;Dead&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Each cell evolves to the next &lt;strong&gt;generation&lt;/strong&gt; depending on the state of itself and its neighbor cells. Here’s a summary of the evolution &lt;a href=&quot;https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#Rules&quot;&gt;rules&lt;/a&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Alive cells die if they have &lt;strong&gt;fewer than two&lt;/strong&gt; (underpopulation) or &lt;strong&gt;more than three&lt;/strong&gt; living neighbors (overpopulation).&lt;/li&gt;
&lt;li&gt;Alive cells stay alive if they have &lt;strong&gt;two or three&lt;/strong&gt; living neighbors.&lt;/li&gt;
&lt;li&gt;Dead cells with &lt;strong&gt;exactly three&lt;/strong&gt; living neighbors become alive (reproduction).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The game’s initial state is the &lt;strong&gt;seed&lt;/strong&gt;, or initial &lt;strong&gt;life pattern&lt;/strong&gt;. In this implementation, the life pattern will be a set of alive cells. The first generation results from applying the above rules to every cell in the seed. The second generation results from applying the rules to the first generation, and so on. So, each generation is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Pure_function&quot;&gt;pure function&lt;/a&gt; of the preceding one.&lt;/p&gt;
&lt;p&gt;The challenge in this project is to program the evolution algorithm in Python and then provide a &lt;a href=&quot;https://en.wikipedia.org/wiki/Command-line_interface&quot;&gt;command-line interface (CLI)&lt;/a&gt; to run the game with different life patterns.&lt;/p&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;headerlink&quot; href=&quot;#prerequisites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The project that you’ll build in this tutorial will require familiarity with general Python programming and especially with object-oriented programming. So, you should have basic knowledge of the following topics:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Working with &lt;a href=&quot;https://realpython.com/python-conditional-statements/&quot;&gt;conditional statements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Writing &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;&lt;code&gt;for&lt;/code&gt;&lt;/a&gt; loops and &lt;a href=&quot;https://realpython.com/list-comprehension-python/&quot;&gt;comprehensions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Working with Python &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;strings&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-tuple/&quot;&gt;tuples&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-list/&quot;&gt;lists&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-sets/&quot;&gt;sets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Creating regular &lt;a href=&quot;https://realpython.com/python-classes/&quot;&gt;classes&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-data-classes/&quot;&gt;data classes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Building command-line interfaces with &lt;a href=&quot;https://realpython.com/command-line-interfaces-python-argparse/&quot;&gt;&lt;code&gt;argparse&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Working with &lt;a href=&quot;https://realpython.com/python-toml/&quot;&gt;TOML&lt;/a&gt; files in Python&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However, if you don’t have all this knowledge yet, then that’s okay! You might learn more by going ahead and giving the project a shot. You can always stop and review the resources linked here if you get stuck.&lt;/p&gt;
&lt;p&gt;With this short overview of your Game of Life project and its prerequisites, you’re ready to start Pythoning. Have fun while coding!&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/conway-game-of-life-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/conway-game-of-life-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Basics Exercises: Modules and Packages</title>
      <id>https://realpython.com/courses/python-modules-packages-exercises/</id>
      <link href="https://realpython.com/courses/python-modules-packages-exercises/"/>
      <updated>2023-11-21T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll practice separating your code into modules, using the import statement to access another module&#x27;s namespace, and creating Python packages.</summary>
      <content type="html">
        &lt;p&gt;In &lt;a href=&quot;https://realpython.com/courses/python-basics-modules-packages/&quot;&gt;Python Basics: Modules and Packages&lt;/a&gt;, you learned how to build an application by putting related code into separate files called &lt;strong&gt;modules&lt;/strong&gt;. You also used the &lt;strong&gt;&lt;code&gt;import&lt;/code&gt; statement&lt;/strong&gt; to use modules in another file.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll practice:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Creating&lt;/strong&gt; your own modules&lt;/li&gt;
&lt;li&gt;Using modules in another file through the &lt;strong&gt;&lt;code&gt;import&lt;/code&gt; statement&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Organizing several modules into a &lt;strong&gt;package&lt;/strong&gt; with &lt;code&gt;__init__.py&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Along the way, you&amp;rsquo;ll also get some insight into how to tackle coding challenges in general, which can be a great way to level up as a developer.&lt;/p&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. You can also check out the other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course. If you&amp;rsquo;re just getting started, then you might want to check out &lt;a href=&quot;https://realpython.com/courses/setting-up-python/&quot;&gt;Python Basics: Setting Up Python&lt;/a&gt; before diving into 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>How to Render Markdown in a Django Application</title>
      <id>https://realpython.com/django-markdown/</id>
      <link href="https://realpython.com/django-markdown/"/>
      <updated>2023-11-20T14:00:00+00:00</updated>
      <summary>In this tutorial, you&#x27;ll learn how to create and render web content in Django with the simplicity and flexibility of the Markdown text formatting language.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;One of Django’s most popular features is the &lt;a href=&quot;https://docs.djangoproject.com/en/4.2/ref/contrib/admin/&quot;&gt;admin interface&lt;/a&gt;. For developers, it provides an out-of-the-box tool kit to work with your project’s data models. And it gives non-technical administrators an intuitive user interface (UI) for interacting with the database and creating website content. However, the Django admin doesn’t provide a way to format text-based content. Using Markdown with Django is a great solution. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Markdown&lt;/strong&gt; is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Plain_text&quot;&gt;plain text&lt;/a&gt; formatting language that can automatically convert to HTML for publishing on the Web. Due to its accessible syntax and widespread use in static site generators, productivity apps, and content management tools, it’s become a popular alternative to rich-text editors for both technical and non-technical content creators. &lt;/p&gt;
&lt;p&gt;There are also several third-party &lt;em&gt;What You See is What You Get&lt;/em&gt; (&lt;a href=&quot;https://en.wikipedia.org/wiki/WYSIWYG&quot;&gt;WYSIWYG&lt;/a&gt;) editors available for Django. These provide an interface for formatting text by using buttons on a menu bar while writing, similar to a word processor program. Other options include using a content management system such as &lt;a href=&quot;https://wagtail.org&quot;&gt;Wagtail CMS&lt;/a&gt;, or working directly in HTML template files. &lt;/p&gt;
&lt;p&gt;But when used in combination with the Django admin, &lt;a href=&quot;https://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt; provides a simpler alternative to a full-blown CMS and a friendlier user experience than working with HTML templates for both developers and content authors. &lt;/p&gt;
&lt;p&gt;Many writers find it faster and more straightforward to work with Markdown than a WYSIWYG interface. Plus, there are additional benefits to separating the text and presentation layers of your web content, including increased security, less risk of syntax errors, and the ability to publish across multiple formats, such as email or PDF documents. &lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll learn how to render Markdown content with Django so that your website’s content creators can take advantage of the simplicity and convenience that have made Markdown such a popular choice for formatting text-based content. This tutorial assumes that you have some prior Django experience, so if you’re totally new to the framework, then you can learn to build your first Django app &lt;a href=&quot;https://realpython.com/get-started-with-django-1/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown=&quot;1&quot;&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/django-markdown-code/&quot; class=&quot;alert-link&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-django-markdown-code&quot; data-focus=&quot;false&quot; markdown=&quot;1&quot;&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to render Markdown in your Django apps.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;how-to-use-markdown-for-content-in-a-django-application&quot;&gt;How to Use Markdown for Content in a Django Application&lt;a class=&quot;headerlink&quot; href=&quot;#how-to-use-markdown-for-content-in-a-django-application&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In a Django application, incorporating Markdown can enhance the content management workflow for users who prefer to format their writing in plain text over a WYSIWYG editor. In this section of the tutorial, you’ll learn how to extend a Django application to allow the creation, management, and rendering of Markdown content. &lt;/p&gt;
&lt;p&gt;You’ll walk through setting up a Django project and app, defining a model to store Markdown content, and creating Django templates to render that content as HTML. Additionally, you’ll explore using Python-Markdown to convert Markdown to HTML within your Django views. &lt;/p&gt;
&lt;p&gt;By the end of this section, you’ll have a fully functional Markdown content management system within your Django application.&lt;/p&gt;
&lt;h3 id=&quot;create-a-django-app-to-display-content&quot;&gt;Create a Django App to Display Content&lt;a class=&quot;headerlink&quot; href=&quot;#create-a-django-app-to-display-content&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To render HTML content written as Markdown with Django, begin by &lt;a href=&quot;https://realpython.com/django-setup/&quot;&gt;creating a new Django project&lt;/a&gt; named &lt;code&gt;dmd_project&lt;/code&gt; inside a Python &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt;. You use &lt;code&gt;dmd&lt;/code&gt; as a shorthand for Django Markdown:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-windows&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body active small&quot; id=&quot;windows-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#windows-1&quot; role=&quot;tab&quot; aria-controls=&quot;windows-1&quot; aria-selected=&quot;true&quot;&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#brands--windows&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Windows&lt;/a&gt;
  &lt;/li&gt;




  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-linuxmacos&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body small&quot; id=&quot;macos-tab-1&quot; data-toggle=&quot;tab&quot; href=&quot;#linux-macos-1&quot; role=&quot;tab&quot; aria-controls=&quot;linux-macos-1&quot; aria-selected=&quot;false&quot;&gt;&lt;span class=&quot;icon baseline text-muted&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#v4--linux&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#v4--apple&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Linux + macOS&lt;/a&gt;
  &lt;/li&gt;

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-1&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;django-markdown&lt;/span&gt;
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;django-admin&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;startproject&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dmd_project&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;django-markdown&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-1&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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;mkdir&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;django-markdown/
&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&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;startproject&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;dmd_project&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;django-markdown/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The only dependencies that you’ll need for this tutorial are Django and the &lt;a href=&quot;https://python-markdown.github.io&quot;&gt;Python-Markdown&lt;/a&gt; package, which provides an API for working with Markdown in Python. &lt;a href=&quot;https://python-markdown.github.io/install/&quot;&gt;Install &lt;code&gt;markdown&lt;/code&gt;&lt;/a&gt; into your virtual environment with &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-windows&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body active small&quot; id=&quot;windows-tab-2&quot; data-toggle=&quot;tab&quot; href=&quot;#windows-2&quot; role=&quot;tab&quot; aria-controls=&quot;windows-2&quot; aria-selected=&quot;true&quot;&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#brands--windows&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Windows&lt;/a&gt;
  &lt;/li&gt;




  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-linuxmacos&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body small&quot; id=&quot;macos-tab-2&quot; data-toggle=&quot;tab&quot; href=&quot;#linux-macos-2&quot; role=&quot;tab&quot; aria-controls=&quot;linux-macos-2&quot; aria-selected=&quot;false&quot;&gt;&lt;span class=&quot;icon baseline text-muted&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#v4--linux&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#v4--apple&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Linux + macOS&lt;/a&gt;
  &lt;/li&gt;

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-2&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-2&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;python&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pip&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;markdown&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-2&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-2&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;markdown
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Now create a new Django app with the &lt;code&gt;manage.py startapp&lt;/code&gt; command:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-windows&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body active small&quot; id=&quot;windows-tab-3&quot; data-toggle=&quot;tab&quot; href=&quot;#windows-3&quot; role=&quot;tab&quot; aria-controls=&quot;windows-3&quot; aria-selected=&quot;true&quot;&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#brands--windows&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Windows&lt;/a&gt;
  &lt;/li&gt;




  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-linuxmacos&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body small&quot; id=&quot;macos-tab-3&quot; data-toggle=&quot;tab&quot; href=&quot;#linux-macos-3&quot; role=&quot;tab&quot; aria-controls=&quot;linux-macos-3&quot; aria-selected=&quot;false&quot;&gt;&lt;span class=&quot;icon baseline text-muted&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#v4--linux&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span class=&quot;icon baseline text-muted mr-1&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#v4--apple&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Linux + macOS&lt;/a&gt;
  &lt;/li&gt;

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-3&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-3&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;django-markdown&lt;/span&gt;
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;python&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;manage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;py&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;startapp&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dmd_app&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-3&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-3&quot; role=&quot;tabpanel&quot;&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--yellow&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&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;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;django-markdown/
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;manage.py&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;startapp&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;dmd_app
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You’ve used the &lt;code&gt;startapp&lt;/code&gt; command to create the &lt;code&gt;dmd_app/&lt;/code&gt; folder, which contains the necessary files for composing that content through the Django admin interface, storing it in your project’s database, and displaying it to users as HTML. Add your new app to the &lt;code&gt;INSTALLED_APPS&lt;/code&gt; setting in your project’s &lt;code&gt;settings.py&lt;/code&gt; file:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    &lt;span class=&quot;mr-2&quot; aria-label=&quot;Filename&quot;&gt;&lt;code style=&quot;color: inherit;&quot;&gt;dmd_project/settings.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&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;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;hll&quot;&gt;    &lt;span class=&quot;s2&quot;&gt;&quot;dmd_app&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To create a new database table for storing your project’s content, define a &lt;code&gt;MarkdownContent&lt;/code&gt; model in the &lt;code&gt;models.py&lt;/code&gt; file inside your &lt;code&gt;dmd_app/&lt;/code&gt; directory:&lt;/p&gt;
&lt;div class=&quot;codeblock mb-3 w-100&quot; aria-label=&quot;Code block&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header d-flex justify-content-between codeblock--blue&quot;&gt;
    &lt;span class=&quot;mr-2 noselect&quot; aria-label=&quot;Language&quot;&gt;Python&lt;/span&gt;
    &lt;span class=&quot;mr-2&quot; aria-label=&quot;Filename&quot;&gt;&lt;code style=&quot;color: inherit;&quot;&gt;dmd_app/models.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style=&quot;position: relative;&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;django.db&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;models&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MarkdownContent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Model&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;n&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;max_length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TextField&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Meta&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;verbose_name_plural&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Markdown content&quot;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;fm&quot;&gt;__str__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    &lt;template class=&quot;codeblock__copied-template&quot;&gt;
      &lt;span class=&quot;small&quot;&gt;&lt;span class=&quot;icon baseline mr-1 text-success&quot;&gt;&lt;svg&gt;&lt;use href=&quot;/static/icons.55e8f03acfe3.svg#@check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Copied!&lt;/span&gt;
    &lt;/template&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/django-markdown/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/django-markdown/ »&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 #181: Computational Thinking &amp; Learning Python During an AI Revolution</title>
      <id>https://realpython.com/podcasts/rpp/181/</id>
      <link href="https://realpython.com/podcasts/rpp/181/"/>
      <updated>2023-11-17T12:00:00+00:00</updated>
      <summary>Has the current growth of artificial intelligence (AI) systems made you wonder what the future holds for Python developers? What are the hidden benefits of learning to program in Python and practicing computational thinking? This week on the show, we speak with author Lawrence Gray about his upcoming book &quot;Mastering Python: A Problem Solving Approach.&quot;</summary>
      <content type="html">
        &lt;p&gt;Has the current growth of artificial intelligence (AI) systems made you wonder what the future holds for Python developers? What are the hidden benefits of learning to program in Python and practicing computational thinking? This week on the show, we speak with author Lawrence Gray about his upcoming book &quot;Mastering Python: A Problem Solving Approach.&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>Python Basics: Modules and Packages</title>
      <id>https://realpython.com/courses/python-basics-modules-packages/</id>
      <link href="https://realpython.com/courses/python-basics-modules-packages/"/>
      <updated>2023-11-14T14:00:00+00:00</updated>
      <summary>In this Python Basics video course, you&#x27;ll learn how to build an application by putting related code into separate files called modules. You&#x27;ll also use the import statement to use modules in another file.</summary>
      <content type="html">
        &lt;p&gt;As you gain experience writing code, you&amp;rsquo;ll eventually work on
projects that are so large that keeping all the code in a single file
becomes cumbersome.&lt;/p&gt;
&lt;p&gt;Instead of writing a single file, you can put related code into separate
files called &lt;strong&gt;modules&lt;/strong&gt;. You can put individual modules together like
building blocks to create a larger application.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Create&lt;/strong&gt; your own modules&lt;/li&gt;
&lt;li&gt;Use modules in another file through the &lt;strong&gt;&lt;code&gt;import&lt;/code&gt; statement&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Organize several modules into a &lt;strong&gt;package&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. You can also check out the other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #180: Studying Python Software Architecture &amp; Creating Lambda Expressions</title>
      <id>https://realpython.com/podcasts/rpp/180/</id>
      <link href="https://realpython.com/podcasts/rpp/180/"/>
      <updated>2023-11-10T12:00:00+00:00</updated>
      <summary>Have you moved through the fundamentals of Python, and are you now considering building a more extensive project or complete application? Where can you study the architecture of existing Python projects and learn best practices? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;Have you moved through the fundamentals of Python, and are you now considering building a more extensive project or complete application? Where can you study the architecture of existing Python projects and learn best practices? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Basics Exercises: Numbers and Math</title>
      <id>https://realpython.com/courses/numbers-and-math-exercises/</id>
      <link href="https://realpython.com/courses/numbers-and-math-exercises/"/>
      <updated>2023-11-07T14:00:00+00:00</updated>
      <summary>In this Python Basics Exercises course, you&#x27;ll practice the math that you need for your Python programming journey. This includes integers and floating-point numbers, arithmetic operators, and string formatting for numbers.</summary>
      <content type="html">
        &lt;p&gt;In &lt;a href=&quot;https://realpython.com/courses/python-basics-numbers-and-math/&quot;&gt;Python Basics: Numbers and Math&lt;/a&gt;, you learned the mathematical skills that you&amp;rsquo;ll need as a Python programmer. Now, you&amp;rsquo;ll take those skills to the next level by actively practicing and applying what you&amp;rsquo;ve learned.&lt;/p&gt;
&lt;p&gt;In this hands-on course, you&amp;rsquo;ll have the opportunity to reinforce your understanding of numbers and math in Python programming through a series of exercises and coding challenges. By actively engaging with the material, you&amp;rsquo;ll gain the confidence you need to apply your learning in real-world scenarios.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll practice:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Creating &lt;strong&gt;integers&lt;/strong&gt; and &lt;strong&gt;floating-point numbers&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Using &lt;strong&gt;arithmetic expressions&lt;/strong&gt;, &lt;strong&gt;math functions&lt;/strong&gt;, and &lt;strong&gt;number methods&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Formatting and displaying numbers in &lt;strong&gt;strings&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Taking numbers as &lt;strong&gt;user input&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In working through these exercises, you&amp;rsquo;ll deepen your knowledge and solidify your understanding of the Python language. You&amp;rsquo;ll not only gain confidence in your programming abilities but also enhance your problem-solving skills.&lt;/p&gt;
&lt;p&gt;This course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. You can also check out other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course. If you&amp;rsquo;re just getting started, then you might want to check out &lt;a href=&quot;https://realpython.com/courses/setting-up-python/&quot;&gt;Python Basics: Setting Up Python&lt;/a&gt; before diving into 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 #179: Improving Your Git Developer Experience in Python</title>
      <id>https://realpython.com/podcasts/rpp/179/</id>
      <link href="https://realpython.com/podcasts/rpp/179/"/>
      <updated>2023-11-03T12:00:00+00:00</updated>
      <summary>Are you getting by with a few fundamental commands for Git when building your Python projects? Would you like to improve your version control techniques and become more efficient with the Git command line? This week on the show, Adam Johnson is back to talk about his new book, &quot;Boost Your Git DX.&quot;</summary>
      <content type="html">
        &lt;p&gt;Are you getting by with a few fundamental commands for Git when building your Python projects? Would you like to improve your version control techniques and become more efficient with the Git command line? This week on the show, Adam Johnson is back to talk about his new book, &quot;Boost Your Git DX.&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>Using the bpython Enhanced REPL</title>
      <id>https://realpython.com/courses/using-bpython-enhanced-repl/</id>
      <link href="https://realpython.com/courses/using-bpython-enhanced-repl/"/>
      <updated>2023-10-31T14:00:00+00:00</updated>
      <summary>In this video course, you&#x27;ll learn about bpython, an alternative Python REPL that brings code suggestions and many other IDE-like features to the terminal. Once you discover how much bpython can improve your productivity, you&#x27;ll never want to return to using the vanilla Python REPL again.</summary>
      <content type="html">
        &lt;p&gt;The standard Python interpreter lets you &lt;a href=&quot;https://realpython.com/run-python-scripts/&quot;&gt;run scripts&lt;/a&gt; from files or &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interactively execute code&lt;/a&gt; on the fly in a so-called &lt;strong&gt;read-evaluate-print loop (REPL)&lt;/strong&gt;. While this is a powerful tool for exploring the language and discovering its libraries through instant feedback on your code inputs, the default REPL shipped with Python has several limitations. Luckily, alternatives like &lt;strong&gt;bpython&lt;/strong&gt; offer a much more programmer-friendly and convenient experience.&lt;/p&gt;
&lt;p&gt;You can use bpython to experiment with your code or quickly test an idea without switching contexts between different programs, just like in an &lt;strong&gt;integrated development environment (IDE)&lt;/strong&gt;. In addition, bpython may be a valuable teaching tool in either a virtual or physical classroom.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this course, you&amp;rsquo;ll learn how to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install and use bpython as your &lt;strong&gt;alternative Python REPL&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Boost your &lt;strong&gt;productivity&lt;/strong&gt; thanks to bpython&amp;rsquo;s unique features&lt;/li&gt;
&lt;li&gt;Tweak bpython&amp;rsquo;s &lt;strong&gt;configuration&lt;/strong&gt; and its &lt;strong&gt;color theme&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use common &lt;strong&gt;keyboard shortcuts&lt;/strong&gt; to code more quickly&lt;/li&gt;
&lt;li&gt;Contribute to bpython&amp;rsquo;s &lt;strong&gt;open-source&lt;/strong&gt; project on GitHub&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before starting this course, make sure you&amp;rsquo;re already familiar with &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;Python basics&lt;/a&gt; and know how to start the &lt;a href=&quot;https://realpython.com/python-repl/&quot;&gt;standard Python REPL&lt;/a&gt; in the command line. In addition, you should be able to &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;install packages with &lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;, ideally into a &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt;.&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 #178: Guiding Scientific Python Library Development</title>
      <id>https://realpython.com/podcasts/rpp/178/</id>
      <link href="https://realpython.com/podcasts/rpp/178/"/>
      <updated>2023-10-27T12:00:00+00:00</updated>
      <summary>How do you prepare a scientific Python project for sharing with others? Could you use some best practices and guidance for packaging, documentation, and testing? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;How do you prepare a scientific Python project for sharing with others? Could you use some best practices and guidance for packaging, documentation, and testing? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Basics Exercises: Building Systems With Classes</title>
      <id>https://realpython.com/courses/building-systems-classes-exercises/</id>
      <link href="https://realpython.com/courses/building-systems-classes-exercises/"/>
      <updated>2023-10-24T14:00:00+00:00</updated>
      <summary>In this Python Basics Exercises course, you&#x27;ll review how to work with classes to build complex systems in Python. By practicing composing classes, inheriting from other classes, and overriding class behavior, you&#x27;ll harness the power of object-oriented programming (OOP).</summary>
      <content type="html">
        &lt;p&gt;In &lt;a href=&quot;https://realpython.com/courses/python-basics-class/&quot;&gt;Python Basics: Building Systems With Classes&lt;/a&gt;, you moved beyond the basics of object-oriented programming (OOP), and started to put those classes to work. In this exercise course you will employ these capabilities to build more complex systems and write readable, reusable code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll practice the following:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Compose&lt;/strong&gt; classes together to create layers of functionality&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Inherit&lt;/strong&gt; and &lt;strong&gt;override&lt;/strong&gt; behavior from other classes to create variations&lt;/li&gt;
&lt;li&gt;Creatively &lt;strong&gt;mix&lt;/strong&gt; and &lt;strong&gt;match&lt;/strong&gt; these approaches&lt;/li&gt;
&lt;li&gt;Instantiate classes with &lt;strong&gt;attributes&lt;/strong&gt; and &lt;strong&gt;methods&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Override&lt;/strong&gt; methods from a parent class&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course. If you&amp;rsquo;re just getting started, then you might want to check out &lt;a href=&quot;https://realpython.com/courses/setting-up-python/&quot;&gt;Python Basics: Setting Up Python&lt;/a&gt; before diving into 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 #177: Welcoming PyPI&#x27;s Safety &amp; Security Engineer Mike Fiedler</title>
      <id>https://realpython.com/podcasts/rpp/177/</id>
      <link href="https://realpython.com/podcasts/rpp/177/"/>
      <updated>2023-10-20T12:00:00+00:00</updated>
      <summary>You may remember a recent Python Package Index (PyPI) announcement about hiring a full-time security engineer. We&#x27;ve also mentioned several current security initiatives from PyPI. This week on the show, we talk with Mike Fiedler about accepting this new role and securing accounts on PyPI.</summary>
      <content type="html">
        &lt;p&gt;You may remember a recent Python Package Index (PyPI) announcement about hiring a full-time security engineer. We&#x27;ve also mentioned several current security initiatives from PyPI. This week on the show, we talk with Mike Fiedler about accepting this new role and securing accounts on PyPI.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python Basics Exercises: Object-Oriented Programming</title>
      <id>https://realpython.com/courses/object-oriented-programming-exercises/</id>
      <link href="https://realpython.com/courses/object-oriented-programming-exercises/"/>
      <updated>2023-10-17T14:00:00+00:00</updated>
      <summary>In this Python Basics Exercises course, you&#x27;ll review OOP, or object-oriented programming. You&#x27;ll practice creating classes, using classes to create new objects, and instantiating classes with attributes.</summary>
      <content type="html">
        &lt;p&gt;In &lt;a href=&quot;https://realpython.com/courses/python-basics-oop/&quot;&gt;Python Basics: Object-Oriented Programming&lt;/a&gt;, you learned how OOP, or object-oriented programming, is a method of structuring a program by bundling related properties and behaviors into individual objects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll practice the following:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a &lt;strong&gt;&lt;code&gt;class&lt;/code&gt;&lt;/strong&gt;, which is like a blueprint for creating an object&lt;/li&gt;
&lt;li&gt;Use classes to create new &lt;strong&gt;objects&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Instantiate classes with &lt;strong&gt;attributes&lt;/strong&gt; and &lt;strong&gt;methods&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Use dunder methods like &lt;strong&gt;init&lt;/strong&gt;() and &lt;strong&gt;str&lt;/strong&gt;()&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This video course is part of the Python Basics series, which accompanies &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;. You can also check out the other &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;Python Basics courses&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Note that you&amp;rsquo;ll be using &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; to &lt;a href=&quot;https://realpython.com/interacting-with-python/&quot;&gt;interact with Python&lt;/a&gt; throughout this course.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #176: Building Python Best Practices and Fundamental Skills</title>
      <id>https://realpython.com/podcasts/rpp/176/</id>
      <link href="https://realpython.com/podcasts/rpp/176/"/>
      <updated>2023-10-13T12:00:00+00:00</updated>
      <summary>What fundamental developer skills are new Python users missing? What best practices might developers without a computer science background be lacking? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What fundamental developer skills are new Python users missing? What best practices might developers without a computer science background be lacking? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #175: Exploring the New Features of Python 3.12</title>
      <id>https://realpython.com/podcasts/rpp/175/</id>
      <link href="https://realpython.com/podcasts/rpp/175/"/>
      <updated>2023-10-06T12:00:00+00:00</updated>
      <summary>Python 3.12 is here! Our regular guests, Geir Arne Hjelle and Christopher Trudeau, return to discuss the new version. Geir Arne coordinated a series of preview articles with several members of the Real Python team this year, and his showcase tutorial, &quot;Python 3.12: Cool New Features for You to Try,&quot; came out on October 2. Christopher&#x27;s video course was posted the next day, covering the topics from the article with visual examples of Python 3.12 in action.</summary>
      <content type="html">
        &lt;p&gt;Python 3.12 is here! Our regular guests, Geir Arne Hjelle and Christopher Trudeau, return to discuss the new version. Geir Arne coordinated a series of preview articles with several members of the Real Python team this year, and his showcase tutorial, &quot;Python 3.12: Cool New Features for You to Try,&quot; came out on October 2. Christopher&#x27;s video course was posted the next day, covering the topics from the article with visual examples of Python 3.12 in action.&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>
