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

  
    <entry>
      <title>TDD With AI Agents: Design the Tests First, Let the Agent Implement</title>
      <id>https://realpython.com/tdd-ai-agents/</id>
      <link href="https://realpython.com/tdd-ai-agents/"/>
      <updated>2026-11-09T14:00:00+00:00</updated>
      <summary>Learn how to use test-driven development (TDD) with AI agents in Python. Design the tests first, then let a coding agent write code that passes them.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;When your test suite passes, you know the code matches your tests. However, if an AI agent wrote both, then all you know is that the agent agrees with itself. TDD with AI agents keeps you in control. First, you design the tests that define what the feature should do, and then the agent writes code to make those tests pass.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Test-driven development (TDD)&lt;/strong&gt; is a cycle in which you write a failing test, make it pass, and then refactor. Working with an AI agent doesn’t change this cycle, but it changes who handles which part. You make the design decisions, and the agent does the drafting:&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/mermaid-diagram-2026-08-30-161211.fbe9eb7da4c6.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-50&quot; src=&quot;https://files.realpython.com/media/mermaid-diagram-2026-08-30-161211.fbe9eb7da4c6.png&quot; width=&quot;1000&quot; height=&quot;1959&quot; srcset=&quot;/cdn-cgi/image/width=250,format=auto/https://files.realpython.com/media/mermaid-diagram-2026-08-30-161211.fbe9eb7da4c6.png 250w, /cdn-cgi/image/width=333,format=auto/https://files.realpython.com/media/mermaid-diagram-2026-08-30-161211.fbe9eb7da4c6.png 333w, /cdn-cgi/image/width=500,format=auto/https://files.realpython.com/media/mermaid-diagram-2026-08-30-161211.fbe9eb7da4c6.png 500w, /cdn-cgi/image/width=1000,format=auto/https://files.realpython.com/media/mermaid-diagram-2026-08-30-161211.fbe9eb7da4c6.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;Loop diagram with five steps showing your steps (define the contract, harden the tests, review the diff) and the agent&#x27;s steps (draft tests, implement), looping back for the next feature.&quot; data-asset=&quot;7413&quot;&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;TDD With AI Agents Loop&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;This loop is how you apply TDD when you let an AI agent write the implementation.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll practice this loop by building a small Python version comparator. Python has its own versioning rules, defined in the &lt;a href=&quot;https://packaging.python.org/en/latest/specifications/version-specifiers/&quot;&gt;version specifiers specification&lt;/a&gt;, where &lt;code&gt;1.0.dev1&lt;/code&gt; sorts before &lt;code&gt;1.0a1&lt;/code&gt;, which sorts before &lt;code&gt;1.0&lt;/code&gt;. While you’d typically use the &lt;a href=&quot;https://pypi.org/project/packaging/&quot;&gt;&lt;code&gt;packaging&lt;/code&gt;&lt;/a&gt; library in production, you’ll build your own here to work with a real contract worth testing.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/tdd-ai-agents-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-tdd-ai-agents-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; you’ll use to build a Python version comparator by designing the tests first and letting an AI agent write the implementation.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “TDD With AI Agents: Design the Tests First, Let the Agent Implement” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/tdd-ai-agents/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #abe5b2;&quot; alt=&quot;A person holding checklists beside a cabinet of locked tests labeled TESTS, with a door marked BLOCKED separating it from a robotic arm and machinery.&quot; src=&quot;https://files.realpython.com/media/TDD-With-AI-Agents-Design-the-Tests-First-Let-the-Agent-Implement_Watermarked.3c6ef089c286.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/TDD-With-AI-Agents-Design-the-Tests-First-Let-the-Agent-Implement_Watermarked.3c6ef089c286.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/TDD-With-AI-Agents-Design-the-Tests-First-Let-the-Agent-Implement_Watermarked.3c6ef089c286.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/TDD-With-AI-Agents-Design-the-Tests-First-Let-the-Agent-Implement_Watermarked.3c6ef089c286.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/TDD-With-AI-Agents-Design-the-Tests-First-Let-the-Agent-Implement_Watermarked.3c6ef089c286.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/tdd-ai-agents/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;TDD With AI Agents: Design the Tests First, Let the Agent Implement&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Check your grasp of TDD with AI agents in Python. Write the contract and tests first, then let a coding agent implement code that passes them.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&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;To follow along with this tutorial, you’ll need a few tools on your machine:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Python&lt;/strong&gt; 3.11 or newer along with &lt;a href=&quot;/ref/tools/pytest/&quot; class=&quot;ref-link&quot;&gt;&lt;strong&gt;&lt;code&gt;pytest&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A coding agent&lt;/strong&gt; that can read and write files in your project&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The sample project imports nothing beyond Python’s &lt;a href=&quot;/ref/glossary/standard-library/&quot; class=&quot;ref-link&quot;&gt;standard library&lt;/a&gt;, so &lt;code&gt;pytest&lt;/code&gt; is the only package that you’ll need to install. Create and activate a &lt;a href=&quot;/ref/glossary/virtual-environment/&quot; class=&quot;ref-link&quot;&gt;virtual environment&lt;/a&gt; first, and then install &lt;code&gt;pytest&lt;/code&gt; into it.&lt;/p&gt;
&lt;p&gt;You should be comfortable with &lt;code&gt;pytest&lt;/code&gt;, including &lt;a href=&quot;https://realpython.com/pytest-python-testing/#parametrization-combining-tests&quot;&gt;how to parametrize tests&lt;/a&gt;. Prior experience with test-driven development helps too, but it isn’t required. If you want some practice first, Real Python’s &lt;a href=&quot;https://realpython.com/courses/test-driven-development-pytest/&quot;&gt;Test-Driven Development With pytest&lt;/a&gt; video course shows you how to write unit tests, run them, and catch bugs before your users do. This tutorial walks you through the cycle one step at a time.&lt;/p&gt;
&lt;p&gt;The demo uses &lt;a href=&quot;https://realpython.com/how-to-use-claude-code/&quot;&gt;Claude Code&lt;/a&gt;, but the loop doesn’t depend on it. Other repository-aware agents like &lt;a href=&quot;https://realpython.com/github-copilot-cli/&quot;&gt;GitHub Copilot CLI&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/antigravity-cli/&quot;&gt;Antigravity CLI&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/opencode-guide/&quot;&gt;OpenCode&lt;/a&gt; can follow the same workflow. If you haven’t worked with one before, then Real Python’s &lt;a href=&quot;https://realpython.com/ai-coding-agents-guide/&quot;&gt;AI coding agents guide&lt;/a&gt; explains how IDE, terminal, pull request, and cloud agents each fit into a Python workflow.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Building With AI Agents Live Course:&lt;/strong&gt; Want to practice this workflow on a bigger project? In Real Python’s &lt;a href=&quot;https://realpython.com/workshops/building-with-agents/&quot;&gt;Building Python Projects With AI Agents&lt;/a&gt; live course, you build a real project with an agent writing every line while you write the specification, judge what comes back, and sharpen your testing judgment. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-loop-for-tdd-with-ai-agents&quot;&gt;The Loop for TDD With AI Agents&lt;a class=&quot;headerlink&quot; href=&quot;#the-loop-for-tdd-with-ai-agents&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Each turn of the loop has five steps. You handle three of them and let the &lt;a href=&quot;/ref/ai-coding-glossary/agent/&quot; class=&quot;ref-link&quot;&gt;agent&lt;/a&gt; handle two:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Define the Contract and Write the First Test:&lt;/strong&gt; You decide how the feature should behave externally and write the first test by hand.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Let the Agent Draft the Tests:&lt;/strong&gt; The agent reads your contract and your first test, then generates more &lt;a href=&quot;/ref/computer-science-glossary/test-case/&quot; class=&quot;ref-link&quot;&gt;test cases&lt;/a&gt; in the same style.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Review and Harden the Tests:&lt;/strong&gt; You check the generated tests against your contract and add any missing edge cases.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Let the Agent Implement:&lt;/strong&gt; The agent writes code until the tests pass, while you block writes to &lt;code&gt;tests/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Review the Diff:&lt;/strong&gt; You check the code changes and then move to the next feature.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Step 2 is where this loop differs from handing over the whole feature to an agent. The agent drafts tests while reading only your contract and your first test. If you ask for tests after the implementation code already exists, then the tests will describe that code, bugs and all.&lt;/p&gt;
&lt;h2 id=&quot;step-1-define-the-contract-and-write-the-first-test&quot;&gt;Step 1: Define the Contract and Write the First Test&lt;a class=&quot;headerlink&quot; href=&quot;#step-1-define-the-contract-and-write-the-first-test&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first step is yours. Before an agent writes anything, you decide what the feature does and lock that decision into a test. Everything the agent produces later has to fit the shape you set here.&lt;/p&gt;
&lt;p&gt;The feature that you’ll build to practice the TDD workflow is a &lt;code&gt;Version&lt;/code&gt; class, which turns a version string into something you can compare with &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt;. You’ll first lay out the project, then define what &lt;code&gt;Version&lt;/code&gt; promises and write the test that pins it down.&lt;/p&gt;
&lt;h3 id=&quot;set-up-the-project&quot;&gt;Set Up the Project&lt;a class=&quot;headerlink&quot; href=&quot;#set-up-the-project&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You’ll build a small project with a &lt;a href=&quot;/ref/best-practices/project-layout/&quot; class=&quot;ref-link&quot;&gt;flat layout&lt;/a&gt;. Your implementation will live in &lt;code&gt;core.py&lt;/code&gt;, and your tests will sit in a separate &lt;code&gt;tests/&lt;/code&gt; directory:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;version-check/
│
├── version_check/
│   ├── __init__.py
│   └── core.py
│
└── tests/
    └── test_core.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Create these directories and files now, including an empty &lt;code&gt;core.py&lt;/code&gt; that the agent will fill in later. Then export the public &lt;code&gt;Version&lt;/code&gt; name from &lt;a href=&quot;https://realpython.com/python-init-py/&quot;&gt;&lt;code&gt;__init__.py&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/tdd-ai-agents/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/tdd-ai-agents/ »&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>Quiz: TDD With AI Agents: Design the Tests First, Let the Agent Implement</title>
      <id>https://realpython.com/quizzes/tdd-ai-agents/</id>
      <link href="https://realpython.com/quizzes/tdd-ai-agents/"/>
      <updated>2026-11-09T12:00:00+00:00</updated>
      <summary>Check your grasp of TDD with AI agents in Python. Write the contract and tests first, then let a coding agent implement code that passes them.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/tdd-ai-agents/&quot;&gt;TDD With AI Agents: Design the Tests First, Let the Agent Implement&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how to define a contract, let an agent
draft tests, harden those tests, fence them off while the agent implements, and review
the resulting diff.&lt;/p&gt;
&lt;p&gt;These habits keep you in charge of the design while the agent does the typing, so you
can trust the code it hands back.&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 Python&#x27;s pip to Manage Your Projects&#x27; Dependencies</title>
      <id>https://realpython.com/what-is-pip/</id>
      <link href="https://realpython.com/what-is-pip/"/>
      <updated>2026-11-08T14:00:00+00:00</updated>
      <summary>What is pip? Learn how to use pip, Python&#x27;s standard package manager, to install and manage packages that aren&#x27;t part of the standard library.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;code&gt;pip&lt;/code&gt; is the standard package manager for Python, used to install and manage libraries that aren’t part of the Python &lt;a href=&quot;/ref/best-practices/stdlib/&quot; class=&quot;ref-link&quot;&gt;standard library&lt;/a&gt;. You use &lt;code&gt;pip&lt;/code&gt; to manage dependencies and install packages from the &lt;a href=&quot;/ref/glossary/pypi/&quot; class=&quot;ref-link&quot;&gt;Python Package Index (PyPI)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can verify if you have &lt;code&gt;pip&lt;/code&gt; by using commands like &lt;code&gt;where pip3&lt;/code&gt; on Windows or &lt;code&gt;which pip3&lt;/code&gt; on Linux and macOS. To install packages listed in a &lt;a href=&quot;/ref/glossary/requirements-txt/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;requirements.txt&lt;/code&gt;&lt;/a&gt; file, use the command &lt;code&gt;pip install -r requirements.txt&lt;/code&gt;. This ensures your environment replicates the specified dependencies, maintaining consistency across different setups.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pip&lt;/code&gt; stands for &lt;strong&gt;“pip installs packages”&lt;/strong&gt;, indicating its primary function.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pip&lt;/code&gt; &lt;strong&gt;manages Python packages&lt;/strong&gt; that aren’t part of the standard library.&lt;/li&gt;
&lt;li&gt;You should use &lt;code&gt;pip&lt;/code&gt; whenever you need &lt;strong&gt;external Python packages&lt;/strong&gt; for your projects.&lt;/li&gt;
&lt;li&gt;You can &lt;strong&gt;install and uninstall packages&lt;/strong&gt; with &lt;code&gt;pip&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You use &lt;strong&gt;requirements files&lt;/strong&gt; to manage projects’ dependencies.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can do a lot with &lt;code&gt;pip&lt;/code&gt;, but the Python community is very active and has created some neat alternatives to &lt;code&gt;pip&lt;/code&gt;. You’ll learn about those later 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&gt;Get Your Cheat Sheet:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/what-is-pip-pdf/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-what-is-pip-pdf&quot; markdown&gt;Click here to download a free pip cheat sheet&lt;/a&gt; that summarizes the most important pip commands.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Using Python&#x27;s pip to Manage Your Projects&#x27; Dependencies” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/what-is-pip/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #abe0e6;&quot; alt=&quot;Using Python&#x27;s pip to Manage Your Projects&#x27; Dependencies&quot; src=&quot;https://files.realpython.com/media/What-is-PIP_Watermarked.4944e95d83ad.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/What-is-PIP_Watermarked.4944e95d83ad.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/What-is-PIP_Watermarked.4944e95d83ad.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/What-is-PIP_Watermarked.4944e95d83ad.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/What-is-PIP_Watermarked.4944e95d83ad.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/what-is-pip/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Using Python&#x27;s pip to Manage Your Projects&#x27; Dependencies&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;In this quiz, you&#x27;ll test your understanding of Python&#x27;s standard package manager, pip, including key commands and how to install packages.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Python for Beginners Live Course:&lt;/strong&gt; Want to put packages like these to work in programs of your own? In Real Python’s &lt;a href=&quot;https://realpython.com/workshops/python-for-beginners/&quot;&gt;Python for Beginners&lt;/a&gt; live course, you build real projects step by step with an instructor, from setting up your environment to code you’re proud of. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;getting-started-with-pip&quot;&gt;Getting Started With &lt;code&gt;pip&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#getting-started-with-pip&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;So, what exactly does &lt;code&gt;pip&lt;/code&gt; do? &lt;a href=&quot;https://pip.pypa.io/en/stable/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt; is a &lt;strong&gt;package manager&lt;/strong&gt; for Python. That means it’s a tool that allows you to install and manage libraries and dependencies that aren’t distributed as part of the standard library. The name &lt;strong&gt;pip&lt;/strong&gt; was introduced by Ian Bicking in 2008:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I’ve finished renaming pyinstall to its new name: pip. The name pip is [an] acronym and declaration: pip installs packages. (&lt;a href=&quot;https://ianbicking.org/blog/2008/10/pyinstall-is-dead-long-live-pip.html&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Package management is so important that Python’s installers have included &lt;code&gt;pip&lt;/code&gt; since versions 3.4 and 2.7.9, for Python 3 and Python 2, respectively. Many Python projects use &lt;code&gt;pip&lt;/code&gt;, which makes it an essential tool for every Pythonista.&lt;/p&gt;
&lt;p&gt;The concept of a package manager might be familiar to you if you’re coming from another programming language. &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript&quot;&gt;JavaScript&lt;/a&gt; uses &lt;a href=&quot;https://www.npmjs.com/&quot;&gt;npm&lt;/a&gt; for package management, &lt;a href=&quot;https://www.ruby-lang.org/en/&quot;&gt;Ruby&lt;/a&gt; uses &lt;a href=&quot;https://rubygems.org/&quot;&gt;gem&lt;/a&gt;, and the &lt;a href=&quot;https://dotnet.microsoft.com/en-us/languages&quot;&gt;.NET platform&lt;/a&gt; uses &lt;a href=&quot;https://www.nuget.org/&quot;&gt;NuGet&lt;/a&gt;. In Python, &lt;code&gt;pip&lt;/code&gt; has become the standard package manager.&lt;/p&gt;
&lt;h3 id=&quot;finding-pip-on-your-system&quot;&gt;Finding &lt;code&gt;pip&lt;/code&gt; on Your System&lt;a class=&quot;headerlink&quot; href=&quot;#finding-pip-on-your-system&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The Python installer gives you the option to install &lt;code&gt;pip&lt;/code&gt; when installing Python on your system. In fact, the option to install &lt;code&gt;pip&lt;/code&gt; with Python is checked by default, so &lt;code&gt;pip&lt;/code&gt; should be ready for you to use after installing Python.&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; On some Linux (Unix) systems like Ubuntu, &lt;code&gt;pip&lt;/code&gt; comes in a separate package called &lt;code&gt;python3-pip&lt;/code&gt;, which you need to install with &lt;code&gt;sudo apt install python3-pip&lt;/code&gt;. It’s not installed by default with the &lt;a href=&quot;/ref/glossary/interpreter/&quot; class=&quot;ref-link&quot;&gt;interpreter&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You can verify that &lt;code&gt;pip&lt;/code&gt; is available by looking for the &lt;code&gt;pip3&lt;/code&gt; executable on your system. Select your operating system below and use your platform-specific command accordingly:&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-bs-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 me-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.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-bs-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; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#v4--linux&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span class=&quot;icon baseline text-muted me-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.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;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&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; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.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 class=&quot;codeblock__contents&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;nb&quot;&gt;where &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pip3&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; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The &lt;code&gt;where&lt;/code&gt; command on Windows will show you where you can find the executable of &lt;code&gt;pip3&lt;/code&gt;. If Windows can’t find an executable named &lt;code&gt;pip3&lt;/code&gt;, then you can also try looking for &lt;code&gt;pip&lt;/code&gt; without the three (&lt;code&gt;3&lt;/code&gt;) at the end.&lt;/p&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;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&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; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.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 class=&quot;codeblock__contents&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;which&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip3
&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; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The &lt;code&gt;which&lt;/code&gt; command on Linux systems and macOS shows you where the &lt;code&gt;pip3&lt;/code&gt; binary file is located.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;On Windows and Unix systems, &lt;code&gt;pip3&lt;/code&gt; may be found in more than one location. This can happen when you have multiple Python versions installed. If you can’t find &lt;code&gt;pip&lt;/code&gt; in any location on your system, then you may consider &lt;a href=&quot;#reinstalling-pip-when-errors-occur&quot;&gt;reinstalling pip&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Instead of running your system &lt;code&gt;pip&lt;/code&gt; directly, you can also run it as a Python &lt;a href=&quot;/ref/glossary/module/&quot; class=&quot;ref-link&quot;&gt;module&lt;/a&gt;. In the next section, you’ll learn how.&lt;/p&gt;
&lt;h3 id=&quot;running-pip-as-a-module&quot;&gt;Running &lt;code&gt;pip&lt;/code&gt; as a Module&lt;a class=&quot;headerlink&quot; href=&quot;#running-pip-as-a-module&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;When you run your system &lt;code&gt;pip&lt;/code&gt; directly, the command itself doesn’t reveal which Python version &lt;code&gt;pip&lt;/code&gt; belongs to. This unfortunately means that you could use &lt;code&gt;pip&lt;/code&gt; to install a package into the site-packages of an old Python version without noticing. To prevent this from happening, you should run &lt;code&gt;pip&lt;/code&gt; as a Python module:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&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; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.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 class=&quot;codeblock__contents&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;pip
&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; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;Notice that you use &lt;code&gt;python -m&lt;/code&gt; to run &lt;code&gt;pip&lt;/code&gt;. The &lt;code&gt;-m&lt;/code&gt; switch tells Python to run a module as an executable of the &lt;code&gt;python&lt;/code&gt; interpreter. This way, you can ensure that your system default Python version runs the &lt;code&gt;pip&lt;/code&gt; command. If you want to learn more about this way of running &lt;code&gt;pip&lt;/code&gt;, then you can read Brett Cannon’s insightful article about &lt;a href=&quot;https://snarky.ca/why-you-should-use-python-m-pip/&quot;&gt;the advantages of using &lt;code&gt;python -m pip&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/what-is-pip/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/what-is-pip/ »&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>Memory Management in Python</title>
      <id>https://realpython.com/python-memory-management/</id>
      <link href="https://realpython.com/python-memory-management/"/>
      <updated>2026-11-08T14:00:00+00:00</updated>
      <summary>Take a deep dive into Python memory management and learn how CPython allocates and frees memory for your objects with arenas, pools, and blocks.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Ever wonder how Python handles your data behind the scenes? How are your &lt;a href=&quot;https://realpython.com/python-variables/&quot;&gt;variables&lt;/a&gt; stored in memory? When do they get deleted?&lt;/p&gt;
&lt;p&gt;In this article, we’re going to do a deep dive into the internals of Python to understand how it handles &lt;a href=&quot;/ref/computer-science-glossary/memory-management/&quot; class=&quot;ref-link&quot;&gt;memory management&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this article, you’ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Learn more about low-level computing, specifically as relates to memory&lt;/li&gt;
&lt;li&gt;Understand how Python abstracts lower-level operations&lt;/li&gt;
&lt;li&gt;Learn about Python’s internal memory management algorithms&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Understanding Python’s internals will also give you better insight into some of Python’s behaviors. Hopefully, you’ll gain a new appreciation for Python as well. So much logic is happening behind the scenes to ensure your program works the way you expect.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-memory-management-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-python-memory-management-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that shows you how reference counting works in CPython.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Memory Management in Python” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-memory-management/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #e6c7ab;&quot; alt=&quot;Memory Management in Python&quot; src=&quot;https://files.realpython.com/media/How-Does-Python-Memory-Management-Work_Watermarked.716f0a905800.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/How-Does-Python-Memory-Management-Work_Watermarked.716f0a905800.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/How-Does-Python-Memory-Management-Work_Watermarked.716f0a905800.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/How-Does-Python-Memory-Management-Work_Watermarked.716f0a905800.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/How-Does-Python-Memory-Management-Work_Watermarked.716f0a905800.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-memory-management/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Memory Management in Python&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your understanding of how CPython allocates, tracks, and frees memory for your Python objects behind the scenes.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Intermediate Python Deep Dive Live Course:&lt;/strong&gt; Curious how Python’s objects work under the hood? Real Python’s &lt;a href=&quot;https://realpython.com/workshops/intermediate-deep-dive/&quot;&gt;Intermediate Python Deep Dive&lt;/a&gt; live course explores Python’s object model, special methods, and more with an instructor and a small cohort. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;memory-is-an-empty-book&quot;&gt;Memory Is an Empty Book&lt;a class=&quot;headerlink&quot; href=&quot;#memory-is-an-empty-book&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You can begin by thinking of a computer’s memory as an empty book intended for short stories. There’s nothing written on the pages yet. Eventually, different authors will come along. Each author wants some space to write their story in.&lt;/p&gt;
&lt;p&gt;Since they aren’t allowed to write over each other, they must be careful about which pages they write in. Before they begin writing, they consult the manager of the book. The manager then decides where in the book they’re allowed to write.&lt;/p&gt;
&lt;p&gt;Since this book is around for a long time, many of the stories in it are no longer relevant. When no one reads or references the stories, they are removed to make room for new stories.&lt;/p&gt;
&lt;p&gt;In essence, computer memory is like that empty book. In fact, it’s common to call fixed-length contiguous blocks of memory &lt;strong&gt;pages&lt;/strong&gt;, so this analogy holds pretty well.&lt;/p&gt;
&lt;p&gt;The authors are like different applications or processes that need to store data in memory. The manager, who decides where the authors can write in the book, plays the role of a memory manager of sorts. The person who removed the old stories to make room for new ones is a garbage collector.&lt;/p&gt;
&lt;h2 id=&quot;memory-management-from-hardware-to-software&quot;&gt;Memory Management: From Hardware to Software&lt;a class=&quot;headerlink&quot; href=&quot;#memory-management-from-hardware-to-software&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Memory management is the process by which applications &lt;a href=&quot;https://realpython.com/read-write-files-python/&quot;&gt;read and write data&lt;/a&gt;. A memory manager determines where to put an application’s data. Since there’s a finite chunk of memory, like the pages in our book analogy, the manager has to find some free space and provide it to the application. This process of providing memory is generally called memory &lt;strong&gt;allocation&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;On the flip side, when data is no longer needed, it can be deleted, or &lt;strong&gt;freed&lt;/strong&gt;. But freed to where? Where did this “memory” come from?&lt;/p&gt;
&lt;p&gt;Somewhere in your computer, there’s a physical device storing data when you’re running your Python programs. There are many layers of abstraction that the Python code goes through before the &lt;a href=&quot;/ref/glossary/object/&quot; class=&quot;ref-link&quot;&gt;objects&lt;/a&gt; actually get to the hardware though.&lt;/p&gt;
&lt;p&gt;One of the main layers above the hardware (such as RAM or a hard drive) is the operating system (OS). It carries out (or denies) requests to read and write memory.&lt;/p&gt;
&lt;p&gt;Above the OS, there are applications, one of which is the default Python implementation (included in your OS or downloaded from &lt;a href=&quot;https://www.python.org/&quot;&gt;python.org&lt;/a&gt;.) Memory management for your Python code is handled by the Python application. The algorithms and structures that the Python application uses for memory management is the focus of this article.&lt;/p&gt;
&lt;h2 id=&quot;the-default-python-implementation&quot;&gt;The Default Python Implementation&lt;a class=&quot;headerlink&quot; href=&quot;#the-default-python-implementation&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The default Python implementation, &lt;a href=&quot;https://realpython.com/cpython-source-code-guide/&quot;&gt;CPython&lt;/a&gt;, is actually written in the &lt;a href=&quot;https://realpython.com/c-for-python-programmers/&quot;&gt;C programming language&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When I first heard this, it blew my mind. A language that’s written in another language?! Well, not really, but sort of.&lt;/p&gt;
&lt;p&gt;The Python language is defined in a &lt;a href=&quot;https://docs.python.org/3/reference/index.html&quot;&gt;reference manual&lt;/a&gt; written in English. However, that manual isn’t all that useful by itself. You still need something to interpret written code based on the rules in the manual.&lt;/p&gt;
&lt;p&gt;You also need something to actually execute interpreted code on a computer. The default Python implementation fulfills both of those requirements. It converts your Python code into instructions that it then runs on a virtual machine.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-memory-management/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-memory-management/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>Thonny: The Beginner-Friendly Python Editor</title>
      <id>https://realpython.com/python-thonny/</id>
      <link href="https://realpython.com/python-thonny/"/>
      <updated>2026-11-07T14:00:00+00:00</updated>
      <summary>Learn how to use Thonny, the free Python IDE built for beginners, to write, run, and debug your code with its step-by-step debugger.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Are you a Python beginner looking for a tool that can support your learning? This article is for you! Every programmer needs a place to write their code. This article will discuss an awesome tool called Thonny that will enable you to start working with Python in a beginner-friendly environment.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this article, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to install Thonny on your computer&lt;/li&gt;
&lt;li&gt;How to navigate Thonny’s user interface to use its built-in features&lt;/li&gt;
&lt;li&gt;How to use Thonny to write and run your code&lt;/li&gt;
&lt;li&gt;How to use Thonny to debug your code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By the end of this article, you’ll be comfortable with the development workflow in Thonny and ready to use it for your Python learning.&lt;/p&gt;
&lt;p&gt;So what is Thonny? Great question!&lt;/p&gt;
&lt;p&gt;Thonny is a free Python &lt;a href=&quot;https://realpython.com/python-ides-code-editors-guide/&quot;&gt;Integrated Development Environment (IDE)&lt;/a&gt; that was especially designed with the beginner Pythonista in mind. Specifically, it has a built-in debugger that can help when you run into nasty bugs, and it offers the ability to do step through &lt;a href=&quot;/ref/glossary/expression/&quot; class=&quot;ref-link&quot;&gt;expression&lt;/a&gt; evaluation, among other really awesome features.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-thonny-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-python-thonny-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that you’ll write, run, and debug with Thonny in this tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Python for Beginners Live Course:&lt;/strong&gt; Just getting started with Python? In Real Python’s &lt;a href=&quot;https://realpython.com/workshops/python-for-beginners/&quot;&gt;Python for Beginners&lt;/a&gt; live course, an instructor guides you from your first program to projects of your own, with live help whenever you get stuck. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;installing-thonny&quot;&gt;Installing Thonny&lt;a class=&quot;headerlink&quot; href=&quot;#installing-thonny&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This article assumes that you have Python 3 installed on your computer. If not, please review &lt;a href=&quot;https://realpython.com/installing-python/&quot;&gt;Python 3 Installation &amp;amp; Setup&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;web-download&quot;&gt;Web Download&lt;a class=&quot;headerlink&quot; href=&quot;#web-download&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The web download can be accessed via a web browser by visiting the &lt;a href=&quot;https://thonny.org/&quot;&gt;Thonny website&lt;/a&gt;. Once on the page, you will see a light gray box in the top right corner like this:&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/Screenshot_2018-10-20_10.52.50.5b35603b597b.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block w-50&quot; src=&quot;https://files.realpython.com/media/Screenshot_2018-10-20_10.52.50.5b35603b597b.png&quot; width=&quot;440&quot; height=&quot;170&quot; srcset=&quot;/cdn-cgi/image/width=110,format=auto/https://files.realpython.com/media/Screenshot_2018-10-20_10.52.50.5b35603b597b.png 110w, /cdn-cgi/image/width=146,format=auto/https://files.realpython.com/media/Screenshot_2018-10-20_10.52.50.5b35603b597b.png 146w, /cdn-cgi/image/width=220,format=auto/https://files.realpython.com/media/Screenshot_2018-10-20_10.52.50.5b35603b597b.png 220w, /cdn-cgi/image/width=440,format=auto/https://files.realpython.com/media/Screenshot_2018-10-20_10.52.50.5b35603b597b.png 440w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;Thonny&#x27;s Web Download Widget&quot; data-asset=&quot;757&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Once you’ve found the gray box, click the appropriate link for your operating system. This tutorial assumes you’ve downloaded version 5.0.&lt;/p&gt;
&lt;h3 id=&quot;command-line-download&quot;&gt;Command Line Download&lt;a class=&quot;headerlink&quot; href=&quot;#command-line-download&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You can also install Thonny via your system’s command line. On Windows, you can do this by starting a program called &lt;strong&gt;Command Prompt&lt;/strong&gt;, while on macOS and Linux you start a program called &lt;strong&gt;Terminal&lt;/strong&gt;. Once you’ve done that, enter the following command:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&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; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.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 class=&quot;codeblock__contents&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;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;nv&quot;&gt;thonny&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;.0
&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; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;h2 id=&quot;the-user-interface&quot;&gt;The User Interface&lt;a class=&quot;headerlink&quot; href=&quot;#the-user-interface&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Let’s make sure you understand what Thonny has to offer. Think of Thonny as the workroom in which you will create amazing Python projects. Your workroom contains a toolbox containing many tools that will enable you to be a rock star Pythonista. In this section, you’ll learn about each of the features of the UI that’ll help you use each of the tools in your Thonny toolbox.&lt;/p&gt;
&lt;h3 id=&quot;the-code-editor-and-shell&quot;&gt;The Code Editor and Shell&lt;a class=&quot;headerlink&quot; href=&quot;#the-code-editor-and-shell&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Now that you have Thonny installed, open the application. You should see a window with several icons across the top, and two white areas:&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/Screenshot_2018-10-20_11.03.57.d46d970db1e6.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block border &quot; src=&quot;https://files.realpython.com/media/Screenshot_2018-10-20_11.03.57.d46d970db1e6.png&quot; width=&quot;1402&quot; height=&quot;1266&quot; srcset=&quot;/cdn-cgi/image/width=350,format=auto/https://files.realpython.com/media/Screenshot_2018-10-20_11.03.57.d46d970db1e6.png 350w, /cdn-cgi/image/width=467,format=auto/https://files.realpython.com/media/Screenshot_2018-10-20_11.03.57.d46d970db1e6.png 467w, /cdn-cgi/image/width=701,format=auto/https://files.realpython.com/media/Screenshot_2018-10-20_11.03.57.d46d970db1e6.png 701w, /cdn-cgi/image/width=1402,format=auto/https://files.realpython.com/media/Screenshot_2018-10-20_11.03.57.d46d970db1e6.png 1402w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;Thonny&#x27;s Main UI&quot; data-asset=&quot;752&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;Notice the two main sections of the window. The top section is your code editor, where you will write all of your code. The bottom half is your Shell, where you will see outputs from your code.&lt;/p&gt;
&lt;h3 id=&quot;the-icons&quot;&gt;The Icons&lt;a class=&quot;headerlink&quot; href=&quot;#the-icons&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Across the top you’ll see several icons. Let’s explore what each of them does. You’ll see an image of the icons below, with a letter above each one. We will use these letters to talk about each of the icons:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-thonny/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-thonny/ »&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 Project Structure: How to Choose the Right Layout</title>
      <id>https://realpython.com/python-application-layouts/</id>
      <link href="https://realpython.com/python-application-layouts/"/>
      <updated>2026-11-07T14:00:00+00:00</updated>
      <summary>Learn how to structure Python projects: pick between flat and src/ layouts, organize your code, and apply the patterns to CLI, web, and GUI apps.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Your Python project structure, also known as your project layout, is the arrangement of files and directories that determines how your code gets imported, tested, and packaged. Choosing between a flat and a &lt;code&gt;src/&lt;/code&gt; layout depends on the type of project you’re building and the trade-offs you accept.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll turn those choices into confident defaults for libraries and for CLI, web, and GUI applications.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;type of project&lt;/strong&gt; you build, whether a &lt;a href=&quot;/ref/computer-science-glossary/script/&quot; class=&quot;ref-link&quot;&gt;script&lt;/a&gt;, an application, or a library, points to the layout that fits.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;flat layout&lt;/strong&gt; keeps the importable &lt;a href=&quot;/ref/glossary/package/&quot; class=&quot;ref-link&quot;&gt;package&lt;/a&gt; at the project root, so you can import it without installing anything.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;&lt;code&gt;src/&lt;/code&gt; layout&lt;/strong&gt; hides the package behind an install step, so your tests exercise the same code your users receive.&lt;/li&gt;
&lt;li&gt;A thin &lt;code&gt;__main__.py&lt;/code&gt; paired with a &lt;code&gt;[project.scripts]&lt;/code&gt; table in &lt;code&gt;pyproject.toml&lt;/code&gt; is the modern way to define the project’s &lt;strong&gt;entry point&lt;/strong&gt;, and it replaces older approaches like &lt;code&gt;setup.py&lt;/code&gt; or a &lt;code&gt;bin/&lt;/code&gt; directory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Domain-named subpackages&lt;/strong&gt; like &lt;code&gt;core/&lt;/code&gt; and &lt;code&gt;api/&lt;/code&gt; scale better than catch-all &lt;a href=&quot;/ref/glossary/module/&quot; class=&quot;ref-link&quot;&gt;modules&lt;/a&gt; like &lt;code&gt;utils.py&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To follow along, it helps if you’re comfortable with &lt;a href=&quot;https://realpython.com/python-modules-packages/&quot;&gt;Python modules and packages&lt;/a&gt; and if you’ve &lt;a href=&quot;https://realpython.com/run-python-scripts/&quot;&gt;run a script&lt;/a&gt; or two from the command line.&lt;/p&gt;
&lt;p&gt;You won’t install anything or build a full application here. Instead, several annotated directory trees will show you why each file belongs where it does.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Cheat Sheet:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-project-structure-cheatsheet/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-python-project-structure-cheatsheet&quot; markdown&gt;Click here to download your free Python project structure cheat sheet&lt;/a&gt; and keep the flat vs. src/ decision and the entry-point wiring within reach on your next project.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Python Project Structure: How to Choose the Right Layout” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-application-layouts/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #abe5b2;&quot; alt=&quot;A person at a drafting machine arranges labeled cards on a layout board beside signs reading LAYOUTS, flat, src, and ORGANIZE MODULES ENTRY POINT SUBPACKAGES, with a Python logo.&quot; src=&quot;https://files.realpython.com/media/Python-Project-Structure-A-Reference-for-Application-Layouts_Watermarked.f845a3dfb2df.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Python-Project-Structure-A-Reference-for-Application-Layouts_Watermarked.f845a3dfb2df.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Python-Project-Structure-A-Reference-for-Application-Layouts_Watermarked.f845a3dfb2df.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Python-Project-Structure-A-Reference-for-Application-Layouts_Watermarked.f845a3dfb2df.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Python-Project-Structure-A-Reference-for-Application-Layouts_Watermarked.f845a3dfb2df.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-application-layouts/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Python Project Structure: How to Choose the Right Layout&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your understanding of Python project structure, from flat and src layouts to organizing packages for CLI, web, and GUI applications.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;understanding-why-python-project-structure-matters&quot;&gt;Understanding Why Python Project Structure Matters&lt;a class=&quot;headerlink&quot; href=&quot;#understanding-why-python-project-structure-matters&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A directory layout can feel like bookkeeping, but it shapes every interaction that you and your teammates have with the code. The payoff of a clear layout shows up in several concrete ways, including the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lower cognitive load&lt;/strong&gt;: When every file sits in a descriptively named directory and has a name that signals what it holds, a contributor who opens the repository for the first time can guess where things live instead of grepping around.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Predictable imports&lt;/strong&gt;: When your directories mirror the way you import them, you can read a module’s dotted import name straight off the directory tree rather than hunting for where it lives.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reliable tests&lt;/strong&gt;: When your tests find the package and modules just as your users will, &lt;a href=&quot;https://realpython.com/pytest-python-testing/&quot;&gt;running &lt;code&gt;pytest&lt;/code&gt;&lt;/a&gt; behaves the same in &lt;a href=&quot;/ref/software-engineering-glossary/continuous-integration/&quot; class=&quot;ref-link&quot;&gt;continuous integration&lt;/a&gt; (CI) as it does on your computer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Smooth packaging&lt;/strong&gt;: When you ship a library to &lt;a href=&quot;/ref/glossary/pypi/&quot; class=&quot;ref-link&quot;&gt;PyPI&lt;/a&gt;, build a CLI binary, deploy a web service in a container, or freeze a desktop app with &lt;a href=&quot;/ref/tools/pyinstaller/&quot; class=&quot;ref-link&quot;&gt;PyInstaller&lt;/a&gt;, the right layout means the &lt;a href=&quot;/ref/glossary/wheel/&quot; class=&quot;ref-link&quot;&gt;wheel&lt;/a&gt;, installer, or image holds exactly what you expect. You end up with no missing assets, no stowaway test files, and no broken entry points.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All of these benefits rest on a vocabulary distinction worth getting straight early. The &lt;em&gt;project&lt;/em&gt; is the whole repository, including its configuration, tests, and documentation. The &lt;em&gt;package&lt;/em&gt; is the importable code that lives inside the project. Keeping the two ideas separate makes the rest of this tutorial click into place because most layout questions come down to where the package sits relative to everything else.&lt;/p&gt;
&lt;p&gt;If you want a refresher on the import machinery behind these ideas, then the &lt;a href=&quot;/ref/best-practices/project-layout/&quot; class=&quot;ref-link&quot;&gt;project layout&lt;/a&gt; reference makes a good companion. With the vocabulary in hand, you can start narrowing your options by naming the type of project that you’re building.&lt;/p&gt;
&lt;h2 id=&quot;identifying-the-type-of-project-youre-building&quot;&gt;Identifying the Type of Project You’re Building&lt;a class=&quot;headerlink&quot; href=&quot;#identifying-the-type-of-project-youre-building&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before you start learning about layouts, you need to know what you’re laying out. Python projects fall into three broad types, and each one has its own &lt;em&gt;typical&lt;/em&gt; layout:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Scripts&lt;/strong&gt;: One or a few &lt;code&gt;.py&lt;/code&gt; files that you run directly. They need no installation and often no &lt;code&gt;pyproject.toml&lt;/code&gt;, or at most a &lt;a href=&quot;https://peps.python.org/pep-0723/&quot;&gt;PEP 723&lt;/a&gt; inline header. A data-cleanup script or a &lt;a href=&quot;https://en.wikipedia.org/wiki/Cron&quot;&gt;&lt;code&gt;cron&lt;/code&gt; job&lt;/a&gt; fits here.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Applications&lt;/strong&gt;: Software that you run or deploy, rather than code that others import. This is where Python application structure varies the most, covering &lt;a href=&quot;/ref/glossary/command-line-interface/&quot; class=&quot;ref-link&quot;&gt;CLIs&lt;/a&gt;, web apps, &lt;a href=&quot;/ref/glossary/graphical-user-interface/&quot; class=&quot;ref-link&quot;&gt;GUI&lt;/a&gt; apps, and background workers. Web apps use frameworks like Django, Flask, or FastAPI, while GUI apps rely on tools like &lt;a href=&quot;https://realpython.com/python-pyqt-gui-calculator/&quot;&gt;PyQt&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-gui-tkinter/&quot;&gt;Tkinter&lt;/a&gt;, Toga, or &lt;a href=&quot;https://realpython.com/mobile-app-kivy-python/&quot;&gt;Kivy&lt;/a&gt;. You ship them as a container, a wheel, or an installer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Libraries&lt;/strong&gt;: Importable code that other projects depend on. You can distribute a library through PyPI, and your users consume it with &lt;code&gt;import package_name&lt;/code&gt;. Familiar examples include &lt;a href=&quot;https://realpython.com/python-requests/&quot;&gt;requests&lt;/a&gt;, HTTPX, and &lt;a href=&quot;https://realpython.com/python-rich-package/&quot;&gt;Rich&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A couple of cases sit at the edges of this taxonomy and could cause confusion:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;plugin&lt;/strong&gt;, like &lt;code&gt;pytest-cov&lt;/code&gt;, is a specialized library that gets consumed through a &lt;code&gt;[project.entry-points]&lt;/code&gt; table in &lt;code&gt;pyproject.toml&lt;/code&gt; instead of a direct &lt;code&gt;import&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;hybrid&lt;/strong&gt;, like &lt;code&gt;pytest&lt;/code&gt;, &lt;a href=&quot;/ref/tools/mypy/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;mypy&lt;/code&gt;&lt;/a&gt;, or &lt;a href=&quot;/ref/tools/black/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;black&lt;/code&gt;&lt;/a&gt;, ships as both a library and a command-line tool. The structural rule is to build the project around the more demanding half, usually the library, and then add the CLI as a thin &lt;code&gt;cli.py&lt;/code&gt; with a &lt;code&gt;[project.scripts]&lt;/code&gt; entry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Naming the project type is the first step of the layout decision because the type alone points you to a default you can adopt unless you have a reason not to:&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;Project Type&lt;/th&gt;
&lt;th&gt;Typical Layout&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Scripts&lt;/td&gt;
&lt;td&gt;None (flat if it grows)&lt;/td&gt;
&lt;td&gt;A script is barely a project, and a flat layout with &lt;code&gt;pyproject.toml&lt;/code&gt; is the natural next step.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Applications&lt;/td&gt;
&lt;td&gt;Flat&lt;/td&gt;
&lt;td&gt;Most web frameworks scaffold projects flat, and you switch to &lt;code&gt;src/&lt;/code&gt; when packaging or wheel deployment matters.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Libraries&lt;/td&gt;
&lt;td&gt;&lt;code&gt;src/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Installation is part of the user contract, since you mostly distribute through PyPI or a private index.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;This table shows where you’ll end up. Here’s a short, repeatable workflow that you’ll follow throughout the rest of this tutorial:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Identify the type of Python project.&lt;/li&gt;
&lt;li&gt;Pick a layout.&lt;/li&gt;
&lt;li&gt;Organize the package from the inside out.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Those three steps will guide your decision-making, starting with the type of project you’re building and the layout it points to:&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/diagram-python-application-layouts-decision.28d246639a35.svg&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/diagram-python-application-layouts-decision.28d246639a35.svg&quot; width=&quot;487&quot; height=&quot;384&quot; alt=&quot;Scripts and applications typically use a flat layout, libraries a src/ layout, and applications switch to src/ when packaging matters.&quot; data-asset=&quot;7212&quot;&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Choosing a Layout by Project Type&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;With the project type settled, take a closer look at the two main layouts that cover nearly every Python project.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-application-layouts/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-application-layouts/ »&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>Absolute vs Relative Imports in Python</title>
      <id>https://realpython.com/absolute-vs-relative-python-imports/</id>
      <link href="https://realpython.com/absolute-vs-relative-python-imports/"/>
      <updated>2026-11-07T14:00:00+00:00</updated>
      <summary>Compare Python relative imports with absolute imports, weigh the pros and cons of each, and learn best practices for writing clean import statements.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;If you’ve worked on a Python project that has more than one file, chances are you’ve had to use an import &lt;a href=&quot;/ref/glossary/statement/&quot; class=&quot;ref-link&quot;&gt;statement&lt;/a&gt; before.&lt;/p&gt;
&lt;p&gt;Even for Pythonistas with a couple of projects under their belt, imports can be confusing! You’re probably reading this because you’d like to gain a deeper understanding of imports in Python, particularly absolute and relative imports.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll learn the differences between the two, as well as their pros and cons. Let’s dive right in!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/absolute-vs-relative-python-imports-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-absolute-vs-relative-python-imports-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to use absolute and relative imports in a Python project.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Absolute vs Relative Imports in Python” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/absolute-vs-relative-python-imports/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #b9abe6;&quot; alt=&quot;Absolute vs Relative Imports in Python&quot; src=&quot;https://files.realpython.com/media/imports.9d65e7197280.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/imports.9d65e7197280.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/imports.9d65e7197280.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/imports.9d65e7197280.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/imports.9d65e7197280.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/absolute-vs-relative-python-imports/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Absolute vs Relative Imports in Python&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your understanding of absolute and relative imports in Python, and learn the syntax, styling, and trade-offs of each approach.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;a-quick-recap-on-imports&quot;&gt;A Quick Recap on Imports&lt;a class=&quot;headerlink&quot; href=&quot;#a-quick-recap-on-imports&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You need to have a good understanding of &lt;a href=&quot;https://realpython.com/python-modules-packages/&quot;&gt;Python modules and packages&lt;/a&gt; to know how imports work. A Python module is a file that has a &lt;code&gt;.py&lt;/code&gt; extension, and a Python package is any folder that has modules inside it (or, in Python 2, a folder that contains an &lt;code&gt;__init__.py&lt;/code&gt; file).&lt;/p&gt;
&lt;p&gt;What happens when you have code in one module that needs to access code in another module or package? You import it!&lt;/p&gt;
&lt;h3 id=&quot;how-imports-work&quot;&gt;How Imports Work&lt;a class=&quot;headerlink&quot; href=&quot;#how-imports-work&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;But how exactly do imports work? Let’s say you import a module &lt;code&gt;abc&lt;/code&gt; like so:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&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;import&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;abc&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; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The first thing Python will do is look up the name &lt;code&gt;abc&lt;/code&gt; in &lt;a href=&quot;https://docs.python.org/3/library/sys.html#sys.modules&quot;&gt;&lt;code&gt;sys.modules&lt;/code&gt;&lt;/a&gt;. This is a cache of all modules that have been previously imported.&lt;/p&gt;
&lt;p&gt;If the name isn’t found in the module cache, Python will proceed to search through a list of built-in modules. These are modules that are compiled directly into the Python interpreter, like &lt;code&gt;sys&lt;/code&gt;, and they’re part of the &lt;a href=&quot;https://docs.python.org/3/library/&quot;&gt;Python Standard Library&lt;/a&gt;. If the name still isn’t found in the built-in modules, Python then searches for it in a list of directories defined by &lt;a href=&quot;https://docs.python.org/3/library/sys.html#sys.path&quot;&gt;&lt;code&gt;sys.path&lt;/code&gt;&lt;/a&gt;. This list usually includes the current directory, which is searched first.&lt;/p&gt;
&lt;p&gt;When Python finds the module, it binds it to a name in the local &lt;a href=&quot;/ref/glossary/scope/&quot; class=&quot;ref-link&quot;&gt;scope&lt;/a&gt;. This means that &lt;code&gt;abc&lt;/code&gt; is now defined and can be used in the current file without throwing a &lt;code&gt;NameError&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If the name is never found, you’ll get a &lt;code&gt;ModuleNotFoundError&lt;/code&gt;. You can find out more about imports in the Python documentation &lt;a href=&quot;https://docs.python.org/3/reference/import.html&quot;&gt;here&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: Security Concerns&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Be aware that Python’s import system presents some significant security risks. This is largely due to its flexibility. For example, the module cache is writable, and it is possible to override core Python functionality using the import system. Importing from third-party packages can also expose your application to security threats.&lt;/p&gt;
&lt;p&gt;Here are a couple of interesting resources to learn more about these security concerns and how to mitigate them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://hackernoon.com/10-common-security-gotchas-in-python-and-how-to-avoid-them-e19fbe265e03&quot;&gt;10 common security gotchas in Python and how to avoid them&lt;/a&gt; by Anthony Shaw (Point 5 talks about Python’s import system.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://talkpython.fm/episodes/show/168/10-python-security-holes-and-how-to-plug-them&quot;&gt;Episode #168: 10 Python security holes and how to plug them&lt;/a&gt; from the TalkPython podcast (The panelists begin talking about imports at around the 27:15 mark.)&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id=&quot;syntax-of-import-statements&quot;&gt;Syntax of Import Statements&lt;a class=&quot;headerlink&quot; href=&quot;#syntax-of-import-statements&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Now that you know how import statements work, let’s explore their syntax. You can import both packages and modules. (Note that importing a package essentially imports the package’s &lt;code&gt;__init__.py&lt;/code&gt; file as a module.) You can also import specific &lt;a href=&quot;/ref/glossary/object/&quot; class=&quot;ref-link&quot;&gt;objects&lt;/a&gt; from a package or module.&lt;/p&gt;
&lt;p&gt;There are generally two types of import syntax. When you use the first one, you import the resource directly, like this:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&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;import&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;abc&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; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/absolute-vs-relative-python-imports/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/absolute-vs-relative-python-imports/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>Managing Multiple Python Versions With pyenv</title>
      <id>https://realpython.com/intro-to-pyenv/</id>
      <link href="https://realpython.com/intro-to-pyenv/"/>
      <updated>2026-11-07T14:00:00+00:00</updated>
      <summary>Learn how to use pyenv to manage multiple Python versions, prevent conflicts, and keep your projects compatible and development smooth.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The &lt;code&gt;pyenv&lt;/code&gt; command-line tool allows you to install and switch between multiple Python versions without interfering with your operating system’s Python installation. This enables you to test code across different &lt;a href=&quot;/ref/glossary/interpreter/&quot; class=&quot;ref-link&quot;&gt;interpreters&lt;/a&gt; and manage project-specific requirements.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll learn how to install and set up &lt;code&gt;pyenv&lt;/code&gt;, manage multiple Python versions, and create virtual environments to work on your coding projects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In Python, &lt;strong&gt;&lt;code&gt;pyenv&lt;/code&gt;&lt;/strong&gt; is a command-line tool for managing &lt;strong&gt;multiple Python versions&lt;/strong&gt; independently of your system installation.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;difference&lt;/strong&gt; between &lt;strong&gt;&lt;code&gt;pyenv&lt;/code&gt;&lt;/strong&gt; and the &lt;strong&gt;&lt;code&gt;venv&lt;/code&gt;&lt;/strong&gt; &lt;a href=&quot;/ref/glossary/module/&quot; class=&quot;ref-link&quot;&gt;module&lt;/a&gt; is that &lt;code&gt;pyenv&lt;/code&gt; allows you to manage multiple Python versions and virtual environments, while &lt;code&gt;venv&lt;/code&gt; allows you to create virtual environments based on a single Python version.&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;pyenv&lt;/code&gt; helps you avoid conflicts with your &lt;strong&gt;system Python&lt;/strong&gt;, freely install &lt;strong&gt;any Python version&lt;/strong&gt; you need, and quickly &lt;strong&gt;switch between versions&lt;/strong&gt; for different projects or tests.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Discover how &lt;code&gt;pyenv&lt;/code&gt; helps you manage multiple Python versions to prevent conflicts, streamline development, and ensure version compatibility across projects.&lt;/p&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Managing Multiple Python Versions With pyenv” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/intro-to-pyenv/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #fe7e73;&quot; alt=&quot;Managing Multiple Python Versions With pyenv&quot; src=&quot;https://files.realpython.com/media/UPDATE-Managing-Multiple-Python-Versions-with-pyenv_Watermarked.4a8dbe20f88e.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/UPDATE-Managing-Multiple-Python-Versions-with-pyenv_Watermarked.4a8dbe20f88e.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/UPDATE-Managing-Multiple-Python-Versions-with-pyenv_Watermarked.4a8dbe20f88e.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/UPDATE-Managing-Multiple-Python-Versions-with-pyenv_Watermarked.4a8dbe20f88e.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/UPDATE-Managing-Multiple-Python-Versions-with-pyenv_Watermarked.4a8dbe20f88e.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/intro-to-pyenv/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Managing Multiple Python Versions With pyenv&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your knowledge of pyenv with this quiz and see how well you can manage multiple Python versions, virtual environments, and dependencies.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Cheat Sheet:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/intro-to-pyenv-cheatsheet/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-intro-to-pyenv-cheatsheet&quot; markdown&gt;Click here to download a free cheat sheet&lt;/a&gt; that shows you how to use pyenv to manage multiple versions of Python.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;understanding-the-benefits-of-using-pyenv&quot;&gt;Understanding the Benefits of Using &lt;code&gt;pyenv&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#understanding-the-benefits-of-using-pyenv&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;pyenv&lt;/code&gt; tool is designed to manage multiple Python versions in a clean way. Even if you already have Python installed on your operating system, it’s worth having &lt;code&gt;pyenv&lt;/code&gt; installed so that you can keep the system Python installation clean and, more importantly, contribute to projects that use a different version of Python.&lt;/p&gt;
&lt;p&gt;The question arises: &lt;em&gt;Why would I use &lt;code&gt;pyenv&lt;/code&gt; if I already have Python installed on my operating system (OS)?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;system Python installation&lt;/strong&gt; is the Python interpreter that’s installed directly on your operating system. You’ll typically have a default system Python installation on macOS or Linux. On Windows, you may need to &lt;a href=&quot;https://realpython.com/installing-python/&quot;&gt;install Python&lt;/a&gt; manually.&lt;/p&gt;
&lt;p&gt;So, why not use the system’s Python installation for your day-to-day coding? One way to look at it is that this Python &lt;em&gt;belongs&lt;/em&gt; to the operating system. In many cases, the OS relies on the preinstalled Python to operate. This means that some OS components may depend on a specific Python version to work correctly. If you change the system Python version or some of the preinstalled &lt;a href=&quot;/ref/glossary/package/&quot; class=&quot;ref-link&quot;&gt;packages&lt;/a&gt;, you could break the OS itself.&lt;/p&gt;
&lt;p&gt;In addition, you may not have much control over what version of Python you can install on your OS. If you want to use the latest features of Python, and you’re on Ubuntu, for example, then you might be out of luck. The available versions might be too old, which means you’ll have to wait for a new OS release to come out. Unfortunately, another Python version can appear in that process, and you’ll never be up to date.&lt;/p&gt;
&lt;p&gt;Another issue appears when you install third-party packages on the system Python using the &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt; command or a similar tool. In this case, you’re installing the Python package globally, which can be a problem if another user—or yourself—wants to install a different version of the package to work on a different project. You can’t have multiple versions of the same package installed in a given Python environment.&lt;/p&gt;
&lt;p&gt;For example, if you have version 1.1.0 of a given package and install version 1.2.0, you’ll be replacing the first one. This might seem harmless. However, projects that depend on the older version can stop working with the new version.&lt;/p&gt;
&lt;p&gt;A critical issue arises when you have multiple projects requiring different Python versions. The system Python installation is often unique. If you update Python, then some projects may stop working. If you don’t update it, then more recent projects may not be able to use the new features of Python.&lt;/p&gt;
&lt;p&gt;Finally, on most operating systems, you need administrative privileges to install a different Python version or third-party packages. This requirement can be a real obstacle in company environments with strict security rules. In short, using the system Python installation comes with some major drawbacks. It can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Break parts of the &lt;strong&gt;operating system&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Prevent you from using the &lt;strong&gt;latest Python versions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Cause issues in projects that require &lt;strong&gt;older Python versions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Block projects that rely on &lt;strong&gt;new Python features&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Require the &lt;strong&gt;intervention of a third person&lt;/strong&gt; when you need to install something&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ideally, you want more flexibility and safety when you use Python for software development. For example, you might need to do some of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install Python in &lt;strong&gt;your user space&lt;/strong&gt; so you don’t depend on system administrators&lt;/li&gt;
&lt;li&gt;Install, manage, and uninstall &lt;strong&gt;multiple Python versions&lt;/strong&gt; freely&lt;/li&gt;
&lt;li&gt;Specify the &lt;strong&gt;exact Python version&lt;/strong&gt; you want to use in each project&lt;/li&gt;
&lt;li&gt;Switch between the &lt;strong&gt;installed versions&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The good news is that &lt;code&gt;pyenv&lt;/code&gt; lets you do all these things. It’s also a great way to &lt;a href=&quot;https://realpython.com/python-pre-release/&quot;&gt;install pre-release versions of Python&lt;/a&gt;, so you can try out new language features or test the release for bugs.&lt;/p&gt;
&lt;h2 id=&quot;installing-pyenv&quot;&gt;Installing &lt;code&gt;pyenv&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#installing-pyenv&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before you install and use &lt;code&gt;pyenv&lt;/code&gt; on Linux or macOS, you may need to fulfill some OS-specific dependencies. These dependencies are mostly development utilities written in &lt;a href=&quot;https://realpython.com/c-for-python-programmers/&quot;&gt;C&lt;/a&gt; that &lt;code&gt;pyenv&lt;/code&gt; uses to build Python from source. On the other hand, Windows users set things up differently, as you’ll soon discover.&lt;/p&gt;
&lt;p&gt;For a more detailed breakdown and explanation of the build dependencies, you can check out &lt;a href=&quot;https://devguide.python.org/setup/#build-dependencies&quot;&gt;Python Developer’s Guide&lt;/a&gt;. In this tutorial, you’ll learn the most common ways to install these dependencies.&lt;/p&gt;
&lt;h3 id=&quot;preparing-linux-systems-for-pyenv&quot;&gt;Preparing Linux Systems for &lt;code&gt;pyenv&lt;/code&gt;&lt;a class=&quot;headerlink&quot; href=&quot;#preparing-linux-systems-for-pyenv&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/intro-to-pyenv/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/intro-to-pyenv/ »&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>Quiz: Managing Multiple Python Versions With pyenv</title>
      <id>https://realpython.com/quizzes/intro-to-pyenv/</id>
      <link href="https://realpython.com/quizzes/intro-to-pyenv/"/>
      <updated>2026-11-07T12:00:00+00:00</updated>
      <summary>Test your knowledge of pyenv with this quiz and see how well you can manage multiple Python versions, virtual environments, and dependencies.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of &lt;a href=&quot;https://realpython.com/intro-to-pyenv/&quot;&gt;Managing Multiple Python Versions With pyenv&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll revisit how to install multiple versions of Python and switch between the installed versions.&lt;/p&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>Regular Expressions: Regexes in Python (Part 1)</title>
      <id>https://realpython.com/regex-python/</id>
      <link href="https://realpython.com/regex-python/"/>
      <updated>2026-11-06T14:00:00+00:00</updated>
      <summary>Learn regex matching in Python with re.search(), and use metacharacters, groups, lookarounds, and flags to find complex patterns in strings.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In this tutorial, you’ll explore &lt;strong&gt;regular expressions&lt;/strong&gt;, also known as &lt;strong&gt;regexes&lt;/strong&gt;, in Python. A regex is a special sequence of characters that defines a pattern for complex string-matching functionality.&lt;/p&gt;
&lt;p&gt;Earlier in this series, in the tutorial &lt;a href=&quot;https://realpython.com/python-strings&quot;&gt;Strings and Character Data in Python&lt;/a&gt;, you learned how to define and manipulate string &lt;a href=&quot;/ref/glossary/object/&quot; class=&quot;ref-link&quot;&gt;objects&lt;/a&gt;. Since then, you’ve seen some ways to determine whether two strings match each other:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You can test whether two strings are equal using the &lt;a href=&quot;https://realpython.com/python-operators-expressions/#comparison-operators&quot;&gt;equality (&lt;code&gt;==&lt;/code&gt;)&lt;/a&gt; operator.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can test whether &lt;a href=&quot;https://realpython.com/python-string-contains-substring/&quot;&gt;one string is a substring&lt;/a&gt; of another with the &lt;a href=&quot;https://realpython.com/python-strings/#string-operators&quot;&gt;&lt;code&gt;in&lt;/code&gt;&lt;/a&gt; operator or the &lt;a href=&quot;https://realpython.com/python-strings/#built-in-string-methods&quot;&gt;built-in string methods&lt;/a&gt; &lt;code&gt;.find()&lt;/code&gt; and &lt;code&gt;.index()&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;String matching like this is a common task in programming, and you can get a lot done with string operators and built-in &lt;a href=&quot;/ref/glossary/method/&quot; class=&quot;ref-link&quot;&gt;methods&lt;/a&gt;. At times, though, you may need more sophisticated pattern-matching capabilities.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to access the &lt;strong&gt;&lt;code&gt;re&lt;/code&gt; &lt;a href=&quot;/ref/glossary/module/&quot; class=&quot;ref-link&quot;&gt;module&lt;/a&gt;&lt;/strong&gt;, which implements regex matching in Python&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;&lt;code&gt;re.search()&lt;/code&gt;&lt;/strong&gt; to match a pattern against a string&lt;/li&gt;
&lt;li&gt;How to create complex matching pattern with regex &lt;strong&gt;metacharacters&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Fasten your seat belt! Regex syntax takes a little getting used to. But once you get comfortable with it, you’ll find regexes almost indispensable in your Python programming.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/regex-python-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-regex-python-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to use regular expressions in Python.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Regular Expressions: Regexes in Python (Part 1)” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/regex-python/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #abe5b2;&quot; alt=&quot;Regular Expressions: Regexes in Python (Part 1)&quot; src=&quot;https://files.realpython.com/media/Regular-Expressions-Regexes-in-Python-Part-1_Watermarked.0423050c5371.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Regular-Expressions-Regexes-in-Python-Part-1_Watermarked.0423050c5371.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Regular-Expressions-Regexes-in-Python-Part-1_Watermarked.0423050c5371.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Regular-Expressions-Regexes-in-Python-Part-1_Watermarked.0423050c5371.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Regular-Expressions-Regexes-in-Python-Part-1_Watermarked.0423050c5371.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/regex-python/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Regular Expressions: Regexes in Python (Part 1)&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your understanding of Python regular expressions: the re module, character classes, anchors, groups, alternation, and flags.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;regexes-in-python-and-their-uses&quot;&gt;Regexes in Python and Their Uses&lt;a class=&quot;headerlink&quot; href=&quot;#regexes-in-python-and-their-uses&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Imagine you have a string object &lt;code&gt;s&lt;/code&gt;. Now suppose you need to write Python code to find out whether &lt;code&gt;s&lt;/code&gt; contains the substring &lt;code&gt;&#x27;123&#x27;&lt;/code&gt;. There are at least a couple ways to do this. You could use the &lt;code&gt;in&lt;/code&gt; operator:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&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; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.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 class=&quot;codeblock__contents&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;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;foo123bar&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;123&quot;&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;True&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; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;If you want to know not only &lt;em&gt;whether&lt;/em&gt; &lt;code&gt;&#x27;123&#x27;&lt;/code&gt; exists in &lt;code&gt;s&lt;/code&gt; but also &lt;em&gt;where&lt;/em&gt; it exists, then you can use &lt;code&gt;.find()&lt;/code&gt; or &lt;code&gt;.index()&lt;/code&gt;. Each of these returns the character position within &lt;code&gt;s&lt;/code&gt; where the substring resides:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&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; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.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 class=&quot;codeblock__contents&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;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;foo123bar&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;123&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;123&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;3&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; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;In these examples, the matching is done by a straightforward character-by-character comparison. That will get the job done in many cases. But sometimes, the problem is more complicated than that.&lt;/p&gt;
&lt;p&gt;For example, rather than searching for a fixed substring like &lt;code&gt;&#x27;123&#x27;&lt;/code&gt;, suppose you wanted to determine whether a string contains &lt;em&gt;any&lt;/em&gt; three consecutive decimal digit characters, as in the strings &lt;code&gt;&#x27;foo123bar&#x27;&lt;/code&gt;, &lt;code&gt;&#x27;foo456bar&#x27;&lt;/code&gt;, &lt;code&gt;&#x27;234baz&#x27;&lt;/code&gt;, and &lt;code&gt;&#x27;qux678&#x27;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Strict character comparisons won’t cut it here. This is where regexes in Python come to the rescue.&lt;/p&gt;
&lt;h3 id=&quot;a-very-brief-history-of-regular-expressions&quot;&gt;A (Very Brief) History of Regular Expressions&lt;a class=&quot;headerlink&quot; href=&quot;#a-very-brief-history-of-regular-expressions&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In 1951, mathematician Stephen Cole Kleene described the concept of a &lt;a href=&quot;https://en.wikipedia.org/wiki/Regular_language&quot;&gt;regular language&lt;/a&gt;, a language that is recognizable by a finite automaton and formally expressible using &lt;a href=&quot;https://en.wikipedia.org/wiki/Regular_expression&quot;&gt;regular expressions&lt;/a&gt;. In the mid-1960s, computer science pioneer &lt;a href=&quot;https://en.wikipedia.org/wiki/Ken_Thompson&quot;&gt;Ken Thompson&lt;/a&gt;, one of the original designers of Unix, implemented pattern matching in the &lt;a href=&quot;https://en.wikipedia.org/wiki/QED_(text_editor)&quot;&gt;QED text editor&lt;/a&gt; using Kleene’s notation.&lt;/p&gt;
&lt;p&gt;Since then, regexes have appeared in many programming languages, editors, and other tools as a means of determining whether a string matches a specified pattern. Python, &lt;a href=&quot;https://realpython.com/oop-in-python-vs-java/&quot;&gt;Java&lt;/a&gt;, and Perl all support regex functionality, as do most Unix tools and many text editors.&lt;/p&gt;
&lt;h3 id=&quot;the-re-module&quot;&gt;The &lt;code&gt;re&lt;/code&gt; Module&lt;a class=&quot;headerlink&quot; href=&quot;#the-re-module&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Regex functionality in Python resides in a module named &lt;code&gt;re&lt;/code&gt;. The &lt;code&gt;re&lt;/code&gt; module contains many useful functions and methods, most of which you’ll learn about in the next tutorial in this series.&lt;/p&gt;
&lt;p&gt;For now, you’ll focus predominantly on one &lt;a href=&quot;/ref/glossary/function/&quot; class=&quot;ref-link&quot;&gt;function&lt;/a&gt;, &lt;code&gt;re.search()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;re.search(&amp;lt;regex&amp;gt;, &amp;lt;string&amp;gt;)&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Scans a string for a regex match.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/regex-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/regex-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>Regular Expressions: Regexes in Python (Part 2)</title>
      <id>https://realpython.com/regex-python-part-2/</id>
      <link href="https://realpython.com/regex-python-part-2/"/>
      <updated>2026-11-06T14:00:00+00:00</updated>
      <summary>Explore more regex tools in Python, including the re module&#x27;s search, substitution, and utility functions, compiled regexes, and match objects.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;In the &lt;a href=&quot;https://realpython.com/regex-python&quot;&gt;previous tutorial&lt;/a&gt; in this series, you covered a lot of ground. You saw how to use &lt;code&gt;re.search()&lt;/code&gt; to perform pattern matching with regexes in Python and learned about the many regex metacharacters and parsing flags that you can use to fine-tune your pattern-matching capabilities.&lt;/p&gt;
&lt;p&gt;But as great as all that is, the &lt;code&gt;re&lt;/code&gt; &lt;a href=&quot;/ref/glossary/module/&quot; class=&quot;ref-link&quot;&gt;module&lt;/a&gt; has much more to offer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this tutorial, you’ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Explore more functions, beyond &lt;code&gt;re.search()&lt;/code&gt;, that the &lt;code&gt;re&lt;/code&gt; module provides&lt;/li&gt;
&lt;li&gt;Learn when and how to precompile a regex in Python into a &lt;strong&gt;regular expression object&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Discover useful things that you can do with the &lt;strong&gt;match object&lt;/strong&gt; returned by the functions in the &lt;code&gt;re&lt;/code&gt; module&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ready? Let’s dig in!&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/regex-python-part-2-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-regex-python-part-2-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; that shows you how to use the functions and objects in Python’s re module.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;re-module-functions&quot;&gt;&lt;code&gt;re&lt;/code&gt; Module Functions&lt;a class=&quot;headerlink&quot; href=&quot;#re-module-functions&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In addition to &lt;code&gt;re.search()&lt;/code&gt;, the &lt;code&gt;re&lt;/code&gt; module contains several other functions to help you perform regex-related tasks.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You saw in the previous tutorial that &lt;code&gt;re.search()&lt;/code&gt; can take an optional &lt;code&gt;&amp;lt;flags&amp;gt;&lt;/code&gt; &lt;a href=&quot;/ref/glossary/argument/&quot; class=&quot;ref-link&quot;&gt;argument&lt;/a&gt;, which specifies &lt;a href=&quot;https://realpython.com/regex-python/#modifying-regular-expression-matching-with-flags&quot;&gt;flags&lt;/a&gt; that modify parsing behavior. All the functions shown below, with the exception of &lt;code&gt;re.escape()&lt;/code&gt;, support the &lt;code&gt;&amp;lt;flags&amp;gt;&lt;/code&gt; argument in the same way.&lt;/p&gt;
&lt;p&gt;You can specify &lt;code&gt;&amp;lt;flags&amp;gt;&lt;/code&gt; as either a positional argument or a keyword argument:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&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;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;regex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;regex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The default for &lt;code&gt;&amp;lt;flags&amp;gt;&lt;/code&gt; is always &lt;code&gt;0&lt;/code&gt;, which indicates no special modification of matching behavior. Remember from the &lt;a href=&quot;https://realpython.com/regex-python/#supported-regular-expression-flags&quot;&gt;discussion of flags in the previous tutorial&lt;/a&gt; that the &lt;code&gt;re.UNICODE&lt;/code&gt; flag is always set by default.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The available regex functions in the Python &lt;code&gt;re&lt;/code&gt; module fall into the following three categories:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Searching functions&lt;/li&gt;
&lt;li&gt;Substitution functions&lt;/li&gt;
&lt;li&gt;Utility functions&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following sections explain these functions in more detail.&lt;/p&gt;
&lt;h3 id=&quot;searching-functions&quot;&gt;Searching Functions&lt;a class=&quot;headerlink&quot; href=&quot;#searching-functions&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Searching functions scan a search string for one or more matches of the specified regex:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;re.search()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Scans a string for a regex match&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;re.match()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Looks for a regex match at the beginning of a string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;re.fullmatch()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Looks for a regex match on an entire string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;re.findall()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Returns a &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;list&lt;/a&gt; of all regex matches in a string&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;re.finditer()&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Returns an &lt;a href=&quot;/ref/glossary/iterator/&quot; class=&quot;ref-link&quot;&gt;iterator&lt;/a&gt; that yields regex matches from a string&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;As you can see from the table, these functions are similar to one another. But each one tweaks the searching functionality in its own way.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;re.search(&amp;lt;regex&amp;gt;, &amp;lt;string&amp;gt;, flags=0)&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Scans a string for a regex match.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If you worked through the &lt;a href=&quot;https://realpython.com/regex-python/&quot;&gt;previous tutorial&lt;/a&gt; in this series, then you should be well familiar with this function by now. &lt;code&gt;re.search(&amp;lt;regex&amp;gt;, &amp;lt;string&amp;gt;)&lt;/code&gt; looks for any location in &lt;code&gt;&amp;lt;string&amp;gt;&lt;/code&gt; where &lt;code&gt;&amp;lt;regex&amp;gt;&lt;/code&gt; matches:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&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; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.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 class=&quot;codeblock__contents&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;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;(\d+)&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;foo123bar&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;re.Match object; span=(3, 6), match=&#x27;123&#x27;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;[a-z]+&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;123FOO456&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flags&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IGNORECASE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;re.Match object; span=(3, 6), match=&#x27;FOO&#x27;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;\d+&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;foo.bar&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The function returns a match object if it finds a match and &lt;a href=&quot;https://realpython.com/null-in-python/&quot;&gt;&lt;code&gt;None&lt;/code&gt;&lt;/a&gt; otherwise.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;re.match(&amp;lt;regex&amp;gt;, &amp;lt;string&amp;gt;, flags=0)&lt;/code&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Looks for a regex match at the beginning of a string.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is identical to &lt;code&gt;re.search()&lt;/code&gt;, except that &lt;code&gt;re.search()&lt;/code&gt; returns a match if &lt;code&gt;&amp;lt;regex&amp;gt;&lt;/code&gt; matches &lt;em&gt;anywhere&lt;/em&gt; in &lt;code&gt;&amp;lt;string&amp;gt;&lt;/code&gt;, whereas &lt;code&gt;re.match()&lt;/code&gt; returns a match only if &lt;code&gt;&amp;lt;regex&amp;gt;&lt;/code&gt; matches at the &lt;em&gt;beginning&lt;/em&gt; of &lt;code&gt;&amp;lt;string&amp;gt;&lt;/code&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&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; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.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 class=&quot;codeblock__contents&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;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;\d+&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;123foobar&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;re.Match object; span=(0, 3), match=&#x27;123&#x27;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;\d+&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;foo123bar&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;re.Match object; span=(3, 6), match=&#x27;123&#x27;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;\d+&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;123foobar&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;re.Match object; span=(0, 3), match=&#x27;123&#x27;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;re&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;\d+&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;foo123bar&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/regex-python-part-2/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/regex-python-part-2/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>A Fake Claude Code Extension Tried to Open a Backdoor to Your PC</title>
      <id>https://realpython.com/ai-news-weekly-2026-11-06/</id>
      <link href="https://realpython.com/ai-news-weekly-2026-11-06/"/>
      <updated>2026-11-06T14:00:00+00:00</updated>
      <summary>Real Python&#x27;s weekly AI news for October 31–November 6, 2026, explained in plain language: A Rigged AI Add-On, an AI Bug Hunter, and Siri Opens Up.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;em&gt;Real Python AI News · Weekly edition · The week of October 31–November 6, 2026&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;card border rounded my-4&quot;&gt;&lt;div class=&quot;card-body&quot;&gt;&lt;div class=&quot;row align-items-center g-3&quot;&gt;&lt;div class=&quot;col-md-6&quot;&gt;&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid &quot; src=&quot;https://files.realpython.com/media/email.593b33f65c83.png&quot; width=&quot;2700&quot; height=&quot;2040&quot; srcset=&quot;/cdn-cgi/image/width=675,format=auto/https://files.realpython.com/media/email.593b33f65c83.png 675w, /cdn-cgi/image/width=900,format=auto/https://files.realpython.com/media/email.593b33f65c83.png 900w, /cdn-cgi/image/width=1350,format=auto/https://files.realpython.com/media/email.593b33f65c83.png 1350w, /cdn-cgi/image/width=2700,format=auto/https://files.realpython.com/media/email.593b33f65c83.png 2700w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;An email from Real Python titled Here Are Your AI News, What Changed and Why It Matters, with lavender newsletter artwork and a What&#x27;s New in AI heading.&quot; data-asset=&quot;7653&quot;&gt;&lt;/figure&gt;
&lt;/div&gt;&lt;div class=&quot;col-md-6&quot;&gt;&lt;p class=&quot;h4 mb-2&quot;&gt;Stop Falling Behind on AI. Catch Up in Five Minutes.&lt;/p&gt;&lt;p class=&quot;mb-3&quot;&gt;New models, new prices, new agent tools, all the time. Our new AI newsletter gives you the handful of stories you actually need as a developer. Free, straight from the Real Python team.&lt;/p&gt;


  &lt;div class=&quot;survey-form__modal&quot;&gt;




&lt;modal-button data-headline=&quot;Stop Falling Behind on AI. Catch Up in Five Minutes.&quot; data-no-footer=&quot;true&quot; data-large=&quot;true&quot; style=&quot;display:inline&quot;&gt;
  &lt;button type=&quot;button&quot; class=&quot;btn btn-primary&quot; data-modal-trigger&gt;
    Get the free roundup
  &lt;/button&gt;
  &lt;template data-modal-content&gt;



&lt;survey-form class=&quot;survey-form d-block&quot; data-slug=&quot;ai-newsletter&quot; data-endpoint=&quot;/api/v1/surveys/ai-newsletter/submissions/&quot; data-draft-endpoint=&quot;/api/v1/surveys/ai-newsletter/draft/&quot; data-view-endpoint=&quot;/api/v1/surveys/ai-newsletter/view/&quot; data-pages=&quot;1&quot; data-definition-hash=&quot;48cf1caeda6e874d&quot; data-captcha=&quot;auto&quot; data-turnstile-sitekey=&quot;0x4AAAAAAAQQUCLRXBi8NnUh&quot; data-surface=&quot;modal&quot; data-authenticated=&quot;0&quot; data-save-progress=&quot;1&quot; data-preview=&quot;0&quot;&gt;
  &lt;template data-resume-notice&gt;
    &lt;div class=&quot;alert alert-light border d-flex justify-content-between align-items-center py-2 mb-4&quot; role=&quot;status&quot;&gt;
      &lt;span class=&quot;text-body-secondary&quot;&gt;&lt;span class=&quot;icon baseline me-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#solid--check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;We saved your progress from earlier.&lt;/span&gt;
      &lt;button type=&quot;button&quot; class=&quot;btn btn-link btn-sm p-0&quot; data-action=&quot;start-over&quot;&gt;Start over&lt;/button&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  &lt;div data-form-area&gt;

    &lt;form novalidate data-survey-form autocomplete=&quot;on&quot;&gt;
      &lt;div class=&quot;visually-hidden&quot; aria-hidden=&quot;true&quot;&gt;
        &lt;label for=&quot;ai-newsletter-hp&quot;&gt;Leave this field empty&lt;/label&gt;
        &lt;input type=&quot;text&quot; name=&quot;hp&quot; id=&quot;ai-newsletter-hp&quot; tabindex=&quot;-1&quot; autocomplete=&quot;off&quot;&gt;
      &lt;/div&gt;

        &lt;fieldset data-page=&quot;0&quot; data-next-label=&quot;Next&quot; tabindex=&quot;-1&quot;&gt;


              &lt;div class=&quot;survey-form__markdown article-body mb-4&quot;&gt;&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid rounded&quot; src=&quot;https://files.realpython.com/media/preview.4b4dadd03735.png&quot; width=&quot;2000&quot; height=&quot;834&quot; srcset=&quot;/cdn-cgi/image/width=500,format=auto/https://files.realpython.com/media/preview.4b4dadd03735.png 500w, /cdn-cgi/image/width=666,format=auto/https://files.realpython.com/media/preview.4b4dadd03735.png 666w, /cdn-cgi/image/width=1000,format=auto/https://files.realpython.com/media/preview.4b4dadd03735.png 1000w, /cdn-cgi/image/width=2000,format=auto/https://files.realpython.com/media/preview.4b4dadd03735.png 2000w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;An email from Real Python titled Here Are Your AI News, What Changed and Why It Matters, with lavender newsletter artwork and badges reading New issue in your inbox and In every issue.&quot; data-asset=&quot;7652&quot;&gt;&lt;/figure&gt;

&lt;p&gt;New models, new prices, new agent tools, all the time. Our new AI newsletter gives you the handful of stories you actually need as a developer.&lt;/p&gt;&lt;/div&gt;






&lt;div class=&quot;survey-form__field&quot; data-field=&quot;frequency&quot; data-field-type=&quot;checkbox&quot;&gt;

    &lt;fieldset data-required&gt;
      &lt;legend class=&quot;form-label fw-bold&quot;&gt;How often should it land in your inbox? Pick as many as you like.&lt;/legend&gt;


        &lt;div class=&quot;survey-form__pills&quot; data-pills&gt;

            &lt;span data-option data-value=&quot;daily&quot;&gt;
              &lt;input type=&quot;checkbox&quot; class=&quot;btn-check&quot; name=&quot;frequency&quot; id=&quot;survey-ai-newsletter-81794e-frequency-daily&quot; value=&quot;daily&quot;&gt;
              &lt;label class=&quot;btn btn-outline-dark rounded-pill survey-form__pill&quot; for=&quot;survey-ai-newsletter-81794e-frequency-daily&quot;&gt;☀️ Daily&lt;/label&gt;
            &lt;/span&gt;

            &lt;span data-option data-value=&quot;weekly&quot;&gt;
              &lt;input type=&quot;checkbox&quot; class=&quot;btn-check&quot; name=&quot;frequency&quot; id=&quot;survey-ai-newsletter-81794e-frequency-weekly&quot; value=&quot;weekly&quot;&gt;
              &lt;label class=&quot;btn btn-outline-dark rounded-pill survey-form__pill&quot; for=&quot;survey-ai-newsletter-81794e-frequency-weekly&quot;&gt;📬 Weekly&lt;/label&gt;
            &lt;/span&gt;

            &lt;span data-option data-value=&quot;monthly&quot;&gt;
              &lt;input type=&quot;checkbox&quot; class=&quot;btn-check&quot; name=&quot;frequency&quot; id=&quot;survey-ai-newsletter-81794e-frequency-monthly&quot; value=&quot;monthly&quot;&gt;
              &lt;label class=&quot;btn btn-outline-dark rounded-pill survey-form__pill&quot; for=&quot;survey-ai-newsletter-81794e-frequency-monthly&quot;&gt;🗓️ Monthly&lt;/label&gt;
            &lt;/span&gt;

        &lt;/div&gt;


    &lt;/fieldset&gt;

  &lt;div class=&quot;invalid-feedback d-block&quot; id=&quot;survey-ai-newsletter-81794e-frequency-error&quot; data-error-for=&quot;frequency&quot; hidden&gt;&lt;/div&gt;
&lt;/div&gt;








&lt;div class=&quot;survey-form__field&quot; data-field=&quot;email&quot; data-field-type=&quot;email&quot;&gt;

    &lt;label class=&quot;form-label fw-bold&quot; for=&quot;survey-ai-newsletter-81794e-email&quot;&gt;Your email address&lt;/label&gt;

    &lt;input type=&quot;email&quot; name=&quot;email&quot; class=&quot;form-control&quot; placeholder=&quot;you@example.com&quot; autocomplete=&quot;email&quot; maxlength=&quot;254&quot; id=&quot;survey-ai-newsletter-81794e-email&quot; required&gt;

  &lt;div class=&quot;invalid-feedback d-block&quot; id=&quot;survey-ai-newsletter-81794e-email-error&quot; data-error-for=&quot;email&quot; hidden&gt;&lt;/div&gt;
&lt;/div&gt;





              &lt;div class=&quot;survey-form__markdown article-body mb-4&quot;&gt;&lt;p&gt;&lt;strong&gt;Free, straight from the Real Python team. Unsubscribe anytime.&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;






        &lt;/fieldset&gt;

      &lt;div class=&quot;alert alert-danger py-2&quot; data-form-error role=&quot;alert&quot; hidden&gt;&lt;/div&gt;
      &lt;div data-turnstile class=&quot;survey-form__turnstile&quot;&gt;&lt;/div&gt;
      &lt;div class=&quot;d-flex align-items-center flex-wrap gap-3 mt-4&quot;&gt;
        &lt;button type=&quot;button&quot; class=&quot;btn btn-link ps-0&quot; data-action=&quot;back&quot; hidden&gt;« Back&lt;/button&gt;
        &lt;button type=&quot;button&quot; class=&quot;btn btn-dark px-4&quot; data-action=&quot;next&quot; hidden&gt;Next&lt;/button&gt;
        &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary px-4&quot; data-action=&quot;submit&quot;&gt;Sign Me Up&lt;/button&gt;
        &lt;span class=&quot;small text-body-secondary&quot; data-saved-indicator hidden&gt;&lt;span class=&quot;icon baseline text-success me-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.ef3487c363c6.svg#solid--check&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Saved&lt;/span&gt;
      &lt;/div&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;noscript&gt;
    &lt;div class=&quot;alert alert-warning mt-3&quot;&gt;This form needs JavaScript to work.&lt;/div&gt;
  &lt;/noscript&gt;
&lt;/survey-form&gt;

  &lt;/template&gt;
&lt;/modal-button&gt;

  &lt;/div&gt;

&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This week’s news is about trust in AI tools: a coding add-on that hides a trap, a model built to find security holes, and new ways to tell where AI-written text comes from. Here’s each story in plain language.&lt;/p&gt;
&lt;h2 id=&quot;a-booby-trapped-claude-code-extension-slips-a-backdoor-onto-programmers-computers&quot;&gt;A Booby-Trapped Claude Code Extension Slips a Backdoor Onto Programmers’ Computers&lt;a class=&quot;headerlink&quot; href=&quot;#a-booby-trapped-claude-code-extension-slips-a-backdoor-onto-programmers-computers&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/s-trojanized-claude-code-extension-plants-framed.5e3360598eaf.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/s-trojanized-claude-code-extension-plants-framed.5e3360598eaf.png&quot; width=&quot;2560&quot; height=&quot;1120&quot; srcset=&quot;/cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/s-trojanized-claude-code-extension-plants-framed.5e3360598eaf.png 640w, /cdn-cgi/image/width=853,format=auto/https://files.realpython.com/media/s-trojanized-claude-code-extension-plants-framed.5e3360598eaf.png 853w, /cdn-cgi/image/width=1280,format=auto/https://files.realpython.com/media/s-trojanized-claude-code-extension-plants-framed.5e3360598eaf.png 1280w, /cdn-cgi/image/width=2560,format=auto/https://files.realpython.com/media/s-trojanized-claude-code-extension-plants-framed.5e3360598eaf.png 2560w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;Screenshot of the source page: Security notice — malicious version of Anthropic.claude-code (2.1.312 and 2.1.313) identified in the Cursor VS Code Extension Marketplace · Cursor&quot; data-asset=&quot;8021&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;A trusted name in an app store for programmers turns out to hide a backdoor. The store belongs to &lt;a href=&quot;/ref/ai-coding-tools/cursor/&quot; class=&quot;ref-link&quot;&gt;Cursor&lt;/a&gt;, an app for writing code.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://cursor.com/blog/claude-code-extension-security-notice&quot;&gt;Cursor’s security notice&lt;/a&gt; says two versions of the extension for &lt;a href=&quot;/ref/ai-coding-tools/claude-code/&quot; class=&quot;ref-link&quot;&gt;Claude Code&lt;/a&gt;, Anthropic’s AI coding assistant, are tampered copies Anthropic didn’t build: 2.1.312 and 2.1.313. They were up for about eleven hours on October 29 and target Windows PCs and Macs.&lt;/p&gt;
&lt;p&gt;The fake extension goes after &lt;em&gt;SSH&lt;/em&gt;, a standard way to log in to a computer from afar. An SSH key works like a pass that needs no password. The extension adds the attacker’s key, labeled &lt;code&gt;svc-telemetry&lt;/code&gt;, to the computer’s approved keys, starts automatically when the computer restarts, and reports details like the username. Cursor says switching SSH on requires administrator rights, so on most machines that step fails.&lt;/p&gt;
&lt;p&gt;Cursor pulled both versions and got the attacker’s server shut down. Researchers at OpenSourceMalware say the copies from Open VSX, Microsoft’s store, and npm (a public library of code) are clean. Cursor users should check their version and look in their SSH settings for a &lt;code&gt;svc-telemetry&lt;/code&gt; key. Since uninstalling may not be enough, Cursor offers cleanup scripts.&lt;/p&gt;
&lt;div class=&quot;container bg-body-tertiary rounded border p-3 my-4&quot;&gt;
&lt;div class=&quot;row align-items-center&quot;&gt;
&lt;div class=&quot;col-3 col-md-2&quot;&gt;
&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid rounded-circle&quot; src=&quot;https://files.realpython.com/media/pacsany.19bcf16f5a00.jpg&quot; width=&quot;1920&quot; height=&quot;1920&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/pacsany.19bcf16f5a00.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/pacsany.19bcf16f5a00.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/pacsany.19bcf16f5a00.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/pacsany.19bcf16f5a00.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;Philipp Acsany&quot; data-asset=&quot;3678&quot;&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;div class=&quot;col&quot;&gt;
&lt;p class=&quot;mb-2&quot;&gt;“Attackers like extension stores because one poisoned upload reaches everyone who trusts the name on it. AI coding assistants make a tempting disguise, since they run right next to company code and passwords. Businesses whose staff code in Cursor now have a version number, time window, and key name to check.”&lt;/p&gt;
&lt;p class=&quot;small mb-0&quot;&gt;&lt;strong&gt;— Philipp Acsany&lt;/strong&gt;, Real Python&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;openais-security-ai-hunts-down-software-flaws-but-only-vetted-experts-can-use-it&quot;&gt;OpenAI’s Security AI Hunts Down Software Flaws, but Only Vetted Experts Can Use It&lt;a class=&quot;headerlink&quot; href=&quot;#openais-security-ai-hunts-down-software-flaws-but-only-vetted-experts-can-use-it&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/s-gpt-6-cyber-advancing-frontier-framed.b72d5ca76362.png&quot; target=&quot;_blank&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/s-gpt-6-cyber-advancing-frontier-framed.b72d5ca76362.png&quot; width=&quot;2560&quot; height=&quot;1120&quot; srcset=&quot;/cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/s-gpt-6-cyber-advancing-frontier-framed.b72d5ca76362.png 640w, /cdn-cgi/image/width=853,format=auto/https://files.realpython.com/media/s-gpt-6-cyber-advancing-frontier-framed.b72d5ca76362.png 853w, /cdn-cgi/image/width=1280,format=auto/https://files.realpython.com/media/s-gpt-6-cyber-advancing-frontier-framed.b72d5ca76362.png 1280w, /cdn-cgi/image/width=2560,format=auto/https://files.realpython.com/media/s-gpt-6-cyber-advancing-frontier-framed.b72d5ca76362.png 2560w&quot; sizes=&quot;(min-width: 1200px) 690px, (min-width: 780px) calc(-5vw + 669px), (min-width: 580px) 510px, calc(100vw - 30px)&quot; alt=&quot;Screenshot of the source page: GPT‑6 Cyber: Advancing the frontier of aligned cybersecurity agents | OpenAI&quot; data-asset=&quot;8192&quot;&gt;&lt;/a&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://openai.com/index/introducing-gpt-6-cyber&quot;&gt;GPT-6 Cyber&lt;/a&gt;&lt;/strong&gt;, OpenAI’s new AI model for security research, hunts for &lt;em&gt;vulnerabilities&lt;/em&gt;, weaknesses in software that attackers could abuse. It then proves each flaw is real by writing an &lt;em&gt;exploit&lt;/em&gt;, working attack code that triggers it.&lt;/p&gt;
&lt;p&gt;OpenAI says its researchers used the model to build exploits for 948 flaws in &lt;a href=&quot;/ref/computer-science-glossary/linux/&quot; class=&quot;ref-link&quot;&gt;Linux&lt;/a&gt;, the software behind most of the world’s servers, and sent 304 critical findings to Linux’s maintainers with suggested fixes. It also credits the model with finding 81 unknown high-severity bugs in Firefox, many already fixed.&lt;/p&gt;
&lt;p&gt;Irregular, an independent testing company, sees a more mixed picture: the model cleared all 11 scenarios in one test set but solved 90 of 288 challenges in another, slightly fewer than OpenAI’s general-purpose GPT-6 Astra.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/ai-news-weekly-2026-11-06/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/ai-news-weekly-2026-11-06/ »&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 #318: Free-Threaded Python: Why Python Devs Should Know About the ABI</title>
      <id>https://realpython.com/podcasts/rpp/318/</id>
      <link href="https://realpython.com/podcasts/rpp/318/"/>
      <updated>2026-11-06T12:00:00+00:00</updated>
      <summary>Why should every Python developer know about the CPython ABI? This week on the show, we speak with Nathan Goldbaum about free-threaded Python and the changes to the Python Application Binary Interface.</summary>
      <content type="html">
        &lt;p&gt;Why should every Python developer know about the CPython ABI? This week on the show, we speak with Nathan Goldbaum about free-threaded Python and the changes to the Python Application Binary Interface.&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>Quiz: LBYL vs EAFP: Preventing or Handling Errors in Python</title>
      <id>https://realpython.com/quizzes/python-lbyl-vs-eafp/</id>
      <link href="https://realpython.com/quizzes/python-lbyl-vs-eafp/"/>
      <updated>2026-11-06T12:00:00+00:00</updated>
      <summary>Test your grasp of Python&#x27;s LBYL and EAFP coding styles, and learn when to prevent errors and when to handle them in your code.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/python-lbyl-vs-eafp/&quot;&gt;LBYL vs EAFP: Preventing or Handling Errors in Python&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit the look before you leap (LBYL) and easier
to ask forgiveness than permission (EAFP) coding styles. You&amp;rsquo;ll also practice spotting
hidden check repetition, race conditions, and common gotchas, and decide which style
fits a given situation.&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>Quiz: Learn With Mentor AI: Getting More Out of Video Courses</title>
      <id>https://realpython.com/quizzes/learn-with-mentor-ai-video-courses/</id>
      <link href="https://realpython.com/quizzes/learn-with-mentor-ai-video-courses/"/>
      <updated>2026-11-05T12:00:00+00:00</updated>
      <summary>Check how you use Mentor AI with Real Python video courses, from asking what the instructor said to quizzing yourself after a lesson.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/learn-with-mentor-ai-video-courses/&quot;&gt;Learn With Mentor AI: Getting More Out of Video Courses&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how to ask Mentor AI about the moment you paused on, point it at a passage in the transcript, and get a different explanation when the first one doesn&amp;rsquo;t click. You&amp;rsquo;ll also review what to do when your terminal doesn&amp;rsquo;t match the recording and how to check what stuck after a lesson.&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>Quiz: Python Plotting With Matplotlib (Guide)</title>
      <id>https://realpython.com/quizzes/python-matplotlib-guide/</id>
      <link href="https://realpython.com/quizzes/python-matplotlib-guide/"/>
      <updated>2026-11-05T12:00:00+00:00</updated>
      <summary>Test your understanding of Python plotting with matplotlib, from Figure and Axes objects to subplots, pandas plotting, and styling.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/python-matplotlib-guide/&quot;&gt;Python Plotting With Matplotlib (Guide)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit matplotlib&amp;rsquo;s object hierarchy, the
difference between the stateful and object-oriented interfaces, how to work with
&lt;code&gt;plt.subplots()&lt;/code&gt;, how pandas plotting builds on matplotlib, and how to configure
styles and interactive mode.&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>Quiz: Beautiful Soup: Build a Web Scraper With Python</title>
      <id>https://realpython.com/quizzes/beautiful-soup-web-scraper-python/</id>
      <link href="https://realpython.com/quizzes/beautiful-soup-web-scraper-python/"/>
      <updated>2026-11-05T12:00:00+00:00</updated>
      <summary>In this quiz, you&#x27;ll test your understanding of web scraping using Python. By working through this quiz, you&#x27;ll revisit how to inspect the HTML structure of a target site, decipher data encoded in URLs, and use Requests and Beautiful Soup for scraping and parsing data.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/beautiful-soup-web-scraper-python/&quot;&gt;web scraping with Python, Requests, and Beautiful Soup&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how to inspect the HTML structure of your target site with your browser&amp;rsquo;s developer tools, decipher data encoded in URLs, use Requests and Beautiful Soup for scraping and parsing internet data, and gain an understanding of what a web scraping pipeline looks like.&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>Quiz: Positron IDE: A Hands-on Python Tutorial</title>
      <id>https://realpython.com/quizzes/positron-ide/</id>
      <link href="https://realpython.com/quizzes/positron-ide/"/>
      <updated>2026-11-04T12:00:00+00:00</updated>
      <summary>Check your understanding of Positron IDE for Python data analysis, from exploring raw data to cleaning it in scripts and notebooks.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/positron-ide/&quot;&gt;Positron IDE&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how to inspect raw data in the Data Explorer,
clean and analyze it with code cells in scripts and notebooks, and connect Posit Assistant
to an LLM provider. You&amp;rsquo;ll also review a few limitations to keep in mind before you adopt
Positron in your own workflow.&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>Converting Documents to Markdown With MarkItDown</title>
      <id>https://realpython.com/courses/converting-documents-markdown-markitdown/</id>
      <link href="https://realpython.com/courses/converting-documents-markdown-markitdown/"/>
      <updated>2026-11-03T14:00:00+00:00</updated>
      <summary>Learn how to use MarkItDown to convert Excel files, PDFs, and images into clean Markdown that&#x27;s ready for LLMs and AI workflows.</summary>
      <content type="html">
        &lt;p&gt;The MarkItDown library lets you quickly turn PDFs, Office files, images, HTML, and URLs into LLM-ready Markdown. In this video course, you&amp;rsquo;ll install MarkItDown, use it in Python code to convert and batch-process documents, connect it to AI clients through its MCP server, and see where it falls short compared to tools like Pandoc.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Markdown&lt;/strong&gt; keeps text straightforward while preserving document structure, which makes it a good input format for &lt;strong&gt;LLMs&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You can &lt;strong&gt;install MarkItDown&lt;/strong&gt; with &lt;code&gt;pip&lt;/code&gt; using the &lt;strong&gt;&lt;code&gt;[all]&lt;/code&gt;&lt;/strong&gt; specifier to pull in optional dependencies.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;&lt;code&gt;.convert()&lt;/code&gt;&lt;/strong&gt; method reads the input document and converts it to &lt;strong&gt;Markdown text&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You can &lt;strong&gt;batch-convert&lt;/strong&gt; a directory of mixed file formats by looping over the files in a Python script.&lt;/li&gt;
&lt;li&gt;You can connect MarkItDown&amp;rsquo;s &lt;strong&gt;MCP server&lt;/strong&gt; to clients like &lt;strong&gt;Claude Desktop&lt;/strong&gt; to expose on-demand conversions to chats.&lt;/li&gt;
&lt;li&gt;MarkItDown can integrate with LLMs to generate &lt;strong&gt;image descriptions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;MarkItDown has &lt;strong&gt;limitations&lt;/strong&gt; with complex layouts, where a tool like &lt;strong&gt;Pandoc&lt;/strong&gt; is a better fit.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With this foundation, you&amp;rsquo;ll be able to judge when MarkItDown is the fastest route from raw files to useful LLM context and when your project calls for a heavier-duty conversion workflow.&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>Quiz: How to Use Claude Code Skills for Better Python Docstrings</title>
      <id>https://realpython.com/quizzes/claude-code-skills/</id>
      <link href="https://realpython.com/quizzes/claude-code-skills/"/>
      <updated>2026-11-03T12:00:00+00:00</updated>
      <summary>Check your understanding of Claude Code skills, from SKILL.md frontmatter and reference files to bundled scripts and personal skills.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of &lt;a href=&quot;https://realpython.com/claude-code-skills/&quot;&gt;How to Use Claude Code Skills for Better Python Docstrings&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll revisit how a skill&amp;rsquo;s description decides when Claude loads it, how reference files keep the context window small, when a bundled script beats having Claude do the work, and how skills compare with hooks and &lt;code&gt;CLAUDE.md&lt;/code&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>Quiz: Converting Documents to Markdown With MarkItDown</title>
      <id>https://realpython.com/quizzes/converting-documents-markdown-markitdown/</id>
      <link href="https://realpython.com/quizzes/converting-documents-markdown-markitdown/"/>
      <updated>2026-11-03T12:00:00+00:00</updated>
      <summary>Check your MarkItDown skills. Convert documents to LLM-ready Markdown, use the MCP server, and get image descriptions. Try the quiz.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of the &lt;a href=&quot;https://realpython.com/courses/converting-documents-markdown-markitdown/&quot;&gt;Converting Documents to Markdown With MarkItDown&lt;/a&gt; video course.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit why Markdown works so well for LLMs, how to convert files with MarkItDown&amp;rsquo;s Python API, how to connect its MCP server to Claude Desktop, and where MarkItDown reaches its limits.&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>Quiz: Advanced Git Tips for Python Developers</title>
      <id>https://realpython.com/quizzes/advanced-git-for-pythonistas/</id>
      <link href="https://realpython.com/quizzes/advanced-git-for-pythonistas/"/>
      <updated>2026-11-02T12:00:00+00:00</updated>
      <summary>Test your advanced Git skills: selecting revisions and ranges, stashing work, comparing commits, and rewriting local history safely.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/advanced-git-for-pythonistas/&quot;&gt;Advanced Git Tips for Python Developers&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how to point Git at specific commits and
ranges, set aside unfinished work with the stash, compare revisions with &lt;code&gt;git diff&lt;/code&gt;,
rewrite local history with amend and rebase, and clean up when something goes wrong.&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 #317: Demystifying Python Memory Management &amp; Choosing a Project Layout</title>
      <id>https://realpython.com/podcasts/rpp/317/</id>
      <link href="https://realpython.com/podcasts/rpp/317/"/>
      <updated>2026-10-30T12:00:00+00:00</updated>
      <summary>How does Python manage memory behind the scenes? What are the common ways to lay out a Python project? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;How does Python manage memory behind the scenes? What are the common ways to lay out a Python project? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>Exploring AI Coding Agent Workflows</title>
      <id>https://realpython.com/courses/exploring-ai-coding-agent-workflows/</id>
      <link href="https://realpython.com/courses/exploring-ai-coding-agent-workflows/"/>
      <updated>2026-10-27T14:00:00+00:00</updated>
      <summary>AI coding agents come in four types: IDE, terminal, PR, and cloud. Learn how each workflow fits into modern Python development.</summary>
      <content type="html">
        &lt;p&gt;AI coding agents can read your code, reason about changes, and act on your behalf. To choose the right one, it helps to understand the four common workflow types: integrated development environment (IDE), terminal, pull request (PR), and cloud.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Identify&lt;/strong&gt; the four common &lt;strong&gt;agent interaction modes&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Understand&lt;/strong&gt; what makes &lt;strong&gt;each workflow distinct&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Recognize&lt;/strong&gt; which mode fits &lt;strong&gt;common development scenarios&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Weigh&lt;/strong&gt; the &lt;strong&gt;risks and tradeoffs&lt;/strong&gt; of each workflow&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whether you&amp;rsquo;re pairing with an agent in your editor or handing off whole tasks to the cloud, you&amp;rsquo;ll come away knowing how much control each workflow gives you and where it&amp;rsquo;s most likely to trip you up.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Codex Live Course:&lt;/strong&gt; Want hands-on practice with one of these workflows? In Real Python&amp;rsquo;s &lt;a href=&quot;https://realpython.com/workshops/codex/&quot;&gt;Codex for Python Developers&lt;/a&gt; live course, you build an entire Python project with Codex, an AI agent that works inside your codebase. The next course runs &lt;strong&gt;November 14 and 15&lt;/strong&gt;!&lt;/p&gt;
&lt;/div&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>AI for Beginners: Use Agents With Confidence</title>
      <id>https://realpython.com/courses/ai-agents-101/</id>
      <link href="https://realpython.com/courses/ai-agents-101/"/>
      <updated>2026-10-26T14:00:00+00:00</updated>
      <summary>Learn how AI agents really work, from models and harnesses to context and skills, so you can get better results and stay in control.</summary>
      <content type="html">
        &lt;p&gt;AI agents don&amp;rsquo;t just answer questions anymore. They read your files, search the web, and take actions on your behalf. In this video course, you&amp;rsquo;ll learn how they really work, from models and harnesses to context and skills, so you can get better results and stay in control.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An AI app is a &lt;strong&gt;model&lt;/strong&gt; that does the thinking, plus a &lt;strong&gt;harness&lt;/strong&gt; that carries out the actions, and many confusing replies come from that split.&lt;/li&gt;
&lt;li&gt;A model works only with what&amp;rsquo;s in its &lt;strong&gt;context&lt;/strong&gt;, so what you hand it shapes every answer.&lt;/li&gt;
&lt;li&gt;Before an agent works for you, you can check &lt;strong&gt;where it runs, what it can touch, what gets sent, and who sees it&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Asking well&lt;/strong&gt; and &lt;strong&gt;starting fresh&lt;/strong&gt; at the right time get you better results and use fewer tokens.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Skills&lt;/strong&gt; let you package a job once and reuse it, and you can build your own.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Along the way, you&amp;rsquo;ll practice in interactive apps and guided mentor sessions, then finish by finding and fixing five problems in an AI assistant&amp;rsquo;s setup.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Free Kit:&lt;/strong&gt; Get the &lt;a href=&quot;https://realpython.com/kits/junior-dev-ai/&quot;&gt;Junior Dev AI Starter Kit&lt;/a&gt; with videos, cheat sheets, and quizzes. You only need a free Real Python account.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Codex Live Course:&lt;/strong&gt; Ready to put an agent to work on real code? In Real Python&amp;rsquo;s &lt;a href=&quot;https://realpython.com/workshops/codex/&quot;&gt;Codex for Python Developers&lt;/a&gt; live course, you build an entire Python project with Codex, an AI agent that works inside your codebase. The next course runs &lt;strong&gt;November 14 and 15&lt;/strong&gt;!&lt;/p&gt;
&lt;/div&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #316: The Future of Python Security: Trends, Challenges, and Solutions</title>
      <id>https://realpython.com/podcasts/rpp/316/</id>
      <link href="https://realpython.com/podcasts/rpp/316/"/>
      <updated>2026-10-23T12:00:00+00:00</updated>
      <summary>How is the Python ecosystem adapting to the modern landscape of software security and supply chain defense? This week on the show, we sit down with Seth Larson, the Python Software Foundation&#x27;s Security Developer in Residence.</summary>
      <content type="html">
        &lt;p&gt;How is the Python ecosystem adapting to the modern landscape of software security and supply chain defense? This week on the show, we sit down with Seth Larson, the Python Software Foundation&#x27;s Security Developer in Residence.&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 itertools By Example</title>
      <id>https://realpython.com/courses/python-itertools-by-example/</id>
      <link href="https://realpython.com/courses/python-itertools-by-example/"/>
      <updated>2026-10-21T14:00:00+00:00</updated>
      <summary>Combine Python&#x27;s itertools functions into memory-efficient pipelines as you deal cards, analyze stock data, and pick relay teams.</summary>
      <content type="html">
        &lt;p&gt;Python&amp;rsquo;s &lt;code&gt;itertools&lt;/code&gt; module is one of the hidden gems of the standard library. Knowing the definitions of its functions isn&amp;rsquo;t enough, though. Its real power lies in composing those functions into fast, memory-efficient, and readable code.&lt;/p&gt;
&lt;p&gt;Rather than introducing &lt;code&gt;itertools&lt;/code&gt; one function at a time, this video course works through practical examples that encourage you to think iteratively: you&amp;rsquo;ll shuffle and deal a deck of cards, analyze seventy years of S&amp;amp;P 500 prices, and pick relay teams for a community swim club.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The functions in &lt;code&gt;itertools&lt;/code&gt; &lt;strong&gt;operate on iterators&lt;/strong&gt; and compose into data pipelines that use far less memory than list-based code.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;batched()&lt;/code&gt; is the built-in way to &lt;strong&gt;split an iterable into chunks&lt;/strong&gt;, and it replaces the hand-rolled &lt;code&gt;grouper()&lt;/code&gt; recipe for most jobs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;combinations()&lt;/code&gt;, &lt;code&gt;permutations()&lt;/code&gt;, and &lt;code&gt;product()&lt;/code&gt; let you &lt;strong&gt;brute-force&lt;/strong&gt; a problem, but they can trigger a combinatorial explosion.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;count()&lt;/code&gt;, &lt;code&gt;repeat()&lt;/code&gt;, &lt;code&gt;cycle()&lt;/code&gt;, and &lt;code&gt;accumulate()&lt;/code&gt; generate &lt;strong&gt;infinite sequences&lt;/strong&gt; and running totals.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pairwise()&lt;/code&gt;, &lt;code&gt;groupby()&lt;/code&gt;, &lt;code&gt;takewhile()&lt;/code&gt;, and &lt;code&gt;dropwhile()&lt;/code&gt; turn real &lt;strong&gt;data analysis&lt;/strong&gt; tasks into short, readable pipelines.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The examples in this video course run on Python 3.15. You&amp;rsquo;ll need Python 3.12 or later for &lt;code&gt;batched()&lt;/code&gt;, and Python 3.15 for unpacking in comprehensions.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Intermediate Python Deep Dive Live Course:&lt;/strong&gt; Want to keep going with iterators and data pipelines? Real Python&amp;rsquo;s &lt;a href=&quot;https://realpython.com/workshops/intermediate-deep-dive/&quot;&gt;Intermediate Python Deep Dive&lt;/a&gt; live course covers advanced iteration techniques, special methods, and Python&amp;rsquo;s object model with an instructor and a small cohort. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>Building an AI Agent With LangGraph and Python</title>
      <id>https://realpython.com/courses/building-ai-agent-langgraph-python/</id>
      <link href="https://realpython.com/courses/building-ai-agent-langgraph-python/"/>
      <updated>2026-10-20T14:00:00+00:00</updated>
      <summary>Learn LangGraph in Python with this hands-on video course and build a stateful AI agent using state graphs, nodes, and conditional edges.</summary>
      <content type="html">
        &lt;p&gt;LangGraph is a versatile Python framework designed for stateful, cyclic, and multi-actor Large Language Model (LLM) applications. LangGraph builds on its parent library, LangChain, and allows you to build sophisticated workflows that can handle the complexities of real-world LLM applications. Throughout this LangGraph video course, you&amp;rsquo;ll build a complete email-processing agent from the ground up.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can use LangGraph to build LLM workflows by &lt;strong&gt;defining state graphs with nodes and edges&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;LangGraph extends LangChain&amp;rsquo;s capabilities by enabling complex LLM workflows with &lt;strong&gt;state, conditional edges, and cycles&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;LLM agents&lt;/strong&gt; in LangGraph autonomously process tasks by using state graphs to make decisions and interact with tools or APIs.&lt;/li&gt;
&lt;li&gt;You can use LangGraph independently of LangChain, though they&amp;rsquo;re often used together to complement each other.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Follow along with the full video course to gain hands-on experience with LangGraph, including setting up workflows and building a LangGraph agent that can autonomously parse and send emails and interact with API services.&lt;/p&gt;
&lt;p&gt;While you&amp;rsquo;ll get a brief primer on &lt;a href=&quot;https://realpython.com/build-llm-rag-chatbot-with-langchain/&quot;&gt;LangChain&lt;/a&gt; in this course, you&amp;rsquo;ll benefit from prior knowledge of LangChain fundamentals. You&amp;rsquo;ll also want to ensure you have intermediate Python knowledge, specifically in &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt; concepts like classes and methods.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;AI Agent From Scratch Live Course:&lt;/strong&gt; Want to see what LangGraph does for you under the hood? In Real Python&amp;rsquo;s &lt;a href=&quot;https://realpython.com/workshops/agentic-loops/&quot;&gt;Build an AI Agent From Scratch in Python&lt;/a&gt; live course, you write the agent loop by hand, then recognize every piece of it in the tools you already use. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>Tell Your Tech Career Story: Proof, Résumés, and Interviews</title>
      <id>https://realpython.com/courses/tell-your-tech-career-story/</id>
      <link href="https://realpython.com/courses/tell-your-tech-career-story/"/>
      <updated>2026-10-20T14:00:00+00:00</updated>
      <summary>Turn your experience into a clear career story with achievement stories, proof of skills, a tailored résumé, and interview practice with Mentor AI.</summary>
      <content type="html">
        &lt;p&gt;Turn your experience into a clear story that employers notice. Choose a target role, build a bank of honest achievement stories, curate proof of your skills, and write a résumé that you can tailor for a new posting in about thirty minutes. Then practice outreach and interviews in guided mentor sessions, and finish with an application campaign for real postings.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Free Kit:&lt;/strong&gt; Get the &lt;a href=&quot;https://realpython.com/kits/tech-career-story/&quot;&gt;Tech Career Story Kit&lt;/a&gt; with career folder templates, a quick reference, and quizzes. You only need a free Real Python account.&lt;/p&gt;
&lt;/div&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #315: Python Pitfalls: Common Mistakes and How to Avoid Them</title>
      <id>https://realpython.com/podcasts/rpp/315/</id>
      <link href="https://realpython.com/podcasts/rpp/315/"/>
      <updated>2026-10-16T12:00:00+00:00</updated>
      <summary>What are common mistakes that Python beginners make, and how do you avoid them? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What are common mistakes that Python beginners make, and how do you avoid them? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>How to Use Python: Taking Your First Steps</title>
      <id>https://realpython.com/courses/python-first-steps/</id>
      <link href="https://realpython.com/courses/python-first-steps/"/>
      <updated>2026-10-13T14:00:00+00:00</updated>
      <summary>Take your first steps with Python. Install it, run your first program, and work with variables, data types, loops, functions, and errors.</summary>
      <content type="html">
        &lt;p&gt;If you&amp;rsquo;re starting fresh with programming and wondering how to use Python, this video course will give you the foundation you need to get started with Python step by step. You&amp;rsquo;ll learn how to install Python, run your first program, and understand the language&amp;rsquo;s clear syntax.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also explore variables, loops, functions, classes, and error handling while discovering tools, coding style, and libraries that help you write effective Python code from day one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can &lt;strong&gt;install Python&lt;/strong&gt; on Windows, macOS, and Linux using binaries, package managers, or distributions like Anaconda.&lt;/li&gt;
&lt;li&gt;You can use the &lt;strong&gt;Python REPL&lt;/strong&gt; to experiment &lt;strong&gt;interactively&lt;/strong&gt; before writing full scripts, modules, and projects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built-in data types&lt;/strong&gt; like strings, lists, dictionaries, and sets provide powerful ways to structure information.&lt;/li&gt;
&lt;li&gt;You can &lt;strong&gt;handle errors&lt;/strong&gt; with syntax checks, exceptions, and debugging practices to keep your code running smoothly.&lt;/li&gt;
&lt;li&gt;Tools like &lt;strong&gt;editors&lt;/strong&gt;, &lt;strong&gt;integrated development environments (IDEs)&lt;/strong&gt;, and &lt;strong&gt;AI assistants&lt;/strong&gt; can boost your productivity when writing Python code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You&amp;rsquo;ll take your first steps with clear examples so you can start coding in Python confidently and build on solid ground.&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 #314: Codemoo: Demonstrating How Coding Agents Work</title>
      <id>https://realpython.com/podcasts/rpp/314/</id>
      <link href="https://realpython.com/podcasts/rpp/314/"/>
      <updated>2026-10-09T12:00:00+00:00</updated>
      <summary>How do you assemble the core pieces of a coding agent? How are developers defining projects through conversation and introspection? This week on the show, Geir Arne Hjelle returns to talk about his recent project to demonstrate how coding agents work under the hood.</summary>
      <content type="html">
        &lt;p&gt;How do you assemble the core pieces of a coding agent? How are developers defining projects through conversation and introspection? This week on the show, Geir Arne Hjelle returns to talk about his recent project to demonstrate how coding agents work under the hood.&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>Exploring the MVC Pattern in Python</title>
      <id>https://realpython.com/courses/exploring-mvc-pattern-python/</id>
      <link href="https://realpython.com/courses/exploring-mvc-pattern-python/"/>
      <updated>2026-10-06T14:00:00+00:00</updated>
      <summary>Learn how the Model-View-Controller pattern organizes Python web apps, then build a small Flask app using models, views, and controllers.</summary>
      <content type="html">
        &lt;p&gt;If you&amp;rsquo;re curious about web development, then you&amp;rsquo;ve likely encountered the abbreviation &lt;strong&gt;MVC&lt;/strong&gt;, which stands for &lt;a href=&quot;https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller&quot;&gt;Model-View-Controller&lt;/a&gt;. You may know that it&amp;rsquo;s a common design pattern that&amp;rsquo;s fundamental to many Python web frameworks and even desktop applications.&lt;/p&gt;
&lt;p&gt;But what exactly does it mean? If you&amp;rsquo;ve had a hard time wrapping your head around the concept, then this video course is for you.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Learn what &lt;strong&gt;models&lt;/strong&gt;, &lt;strong&gt;views&lt;/strong&gt;, and &lt;strong&gt;controllers&lt;/strong&gt; are &lt;strong&gt;conceptually&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Follow a &lt;strong&gt;user&amp;rsquo;s request&lt;/strong&gt; through an MVC application from end to end&lt;/li&gt;
&lt;li&gt;Tie your conceptual understanding back to &lt;strong&gt;concrete web development examples&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Build a small &lt;strong&gt;Flask&lt;/strong&gt; app that puts the MVC pattern into practice&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #313: Python 3.15: Exploring the New Features</title>
      <id>https://realpython.com/podcasts/rpp/313/</id>
      <link href="https://realpython.com/podcasts/rpp/313/"/>
      <updated>2026-10-02T12:00:00+00:00</updated>
      <summary>Python 3.15 is (almost*) here! Christopher Trudeau and Bartosz Zaczyński return to discuss the new version. Bartosz coordinated the series of preview articles with members of the Real Python team and wrote the showcase tutorial, &quot;Python 3.15: Cool New Features for You to Try.&quot; Christopher&#x27;s video course &quot;What&#x27;s New in Python 3.15&quot; covers the topics from the article and shows the new features in action.</summary>
      <content type="html">
        &lt;p&gt;Python 3.15 is (almost*) here! Christopher Trudeau and Bartosz Zaczyński return to discuss the new version. Bartosz coordinated the series of preview articles with members of the Real Python team and wrote the showcase tutorial, &quot;Python 3.15: Cool New Features for You to Try.&quot; Christopher&#x27;s video course &quot;What&#x27;s New in Python 3.15&quot; covers the topics from the article and shows the new features 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>
  
    <entry>
      <title>Community Videos</title>
      <id>https://realpython.com/courses/community-videos/</id>
      <link href="https://realpython.com/courses/community-videos/"/>
      <updated>2026-09-30T14:00:00+00:00</updated>
      <summary>Watch Real Python&#x27;s YouTube videos right here on the site, with the resources mentioned in each video and a full transcript.</summary>
      <content type="html">
        &lt;p&gt;This collection gathers the videos that the Real Python team published on the &lt;a href=&quot;https://www.youtube.com/@realpython&quot;&gt;Real Python YouTube channel&lt;/a&gt;, so you can watch them right here on Real Python.&lt;/p&gt;
&lt;p&gt;Each lesson contains the full video, the resources mentioned in it, and a transcript. The newest video is always at the top, and new videos are added as they&amp;rsquo;re released.&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>What&#x27;s New in Python 3.15</title>
      <id>https://realpython.com/courses/whats-new-in-python-315/</id>
      <link href="https://realpython.com/courses/whats-new-in-python-315/"/>
      <updated>2026-09-29T14:00:00+00:00</updated>
      <summary>Explore the new features in Python 3.15, including lazy imports, frozendict, sentinel values, a sampling profiler, and a faster JIT.</summary>
      <content type="html">
        &lt;p&gt;Python 3.15 is here! After a last-minute third release candidate, the &lt;a href=&quot;https://www.python.org/downloads/release/python-3150/&quot;&gt;final release&lt;/a&gt; came out on October 9, 2026, so you can install it today and start using the new features in your own code. This is a good time to see what the new version has in store for you.&lt;/p&gt;
&lt;p&gt;This release trims the time you spend waiting. Imports can wait until you need them, the JIT compiler got faster, and a new profiler shows you where the remaining slow parts hide. There&amp;rsquo;s also plenty in it for everyday code, including two new built-in types.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll explore features like:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lazy imports&lt;/strong&gt; with the new &lt;code&gt;lazy&lt;/code&gt; keyword&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;frozendict&lt;/code&gt;&lt;/strong&gt;, an immutable mapping in the built-ins&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;sentinel&lt;/code&gt;&lt;/strong&gt;, a clean way to say &amp;ldquo;no value given&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A sampling profiler&lt;/strong&gt; that you can point at a running process&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UTF-8&lt;/strong&gt; as the default encoding everywhere&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An upgraded JIT compiler&lt;/strong&gt; with measurable speedups&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #312: Navigating AI in Open Source: Insights From Wagtail</title>
      <id>https://realpython.com/podcasts/rpp/312/</id>
      <link href="https://realpython.com/podcasts/rpp/312/"/>
      <updated>2026-09-25T12:00:00+00:00</updated>
      <summary>How should you manage AI contributions to an open-source project? How do you measure the impact of using AI tools for development, and what generative features do end users want from a content management system? This week on the show, we speak with Thibaud Colas and Meagen Voss from Wagtail about the complex considerations software organizations are currently facing.</summary>
      <content type="html">
        &lt;p&gt;How should you manage AI contributions to an open-source project? How do you measure the impact of using AI tools for development, and what generative features do end users want from a content management system? This week on the show, we speak with Thibaud Colas and Meagen Voss from Wagtail about the complex considerations software organizations are currently facing.&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 #311: Django Developers Survey Results &amp; Reproducible Python Builds</title>
      <id>https://realpython.com/podcasts/rpp/311/</id>
      <link href="https://realpython.com/podcasts/rpp/311/"/>
      <updated>2026-09-11T12:00:00+00:00</updated>
      <summary>What are the latest trends uncovered in the 2026 Django Developers Survey? How are Django users employing LLMs in their development process? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What are the latest trends uncovered in the 2026 Django Developers Survey? How are Django users employing LLMs in their development process? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #310: Performance Engineering: Profiling and Making Apps Fast by Default</title>
      <id>https://realpython.com/podcasts/rpp/310/</id>
      <link href="https://realpython.com/podcasts/rpp/310/"/>
      <updated>2026-09-04T12:00:00+00:00</updated>
      <summary>How do you plan for the performance of your Python applications? What does a performance budget entail, and where should you spend your resources? This week on the show, we speak with Den Odell about his new book &quot;Fast by Default: Practical Performance Engineering.&quot;</summary>
      <content type="html">
        &lt;p&gt;How do you plan for the performance of your Python applications? What does a performance budget entail, and where should you spend your resources? This week on the show, we speak with Den Odell about his new book &quot;Fast by Default: Practical Performance Engineering.&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>The Real Python Podcast – Episode #309: Exploring Complex Systems &amp; Maintainable Data Science Pipelines</title>
      <id>https://realpython.com/podcasts/rpp/309/</id>
      <link href="https://realpython.com/podcasts/rpp/309/"/>
      <updated>2026-08-28T12:00:00+00:00</updated>
      <summary>What are the key characteristics of complex systems, and what are practical patterns for tackling complex coding problems? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What are the key characteristics of complex systems, and what are practical patterns for tackling complex coding problems? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: FastAPI: Python API Development With Light Speed</title>
      <id>https://realpython.com/learning-paths/fastapi/</id>
      <link href="https://realpython.com/learning-paths/fastapi/"/>
      <updated>2026-07-22T12:00:00+00:00</updated>
      <summary>Learn FastAPI from the ground up. Build REST APIs, serve web pages with Jinja2 templates, and create a complete URL shortener project in Python.</summary>
      <content type="html">
        &lt;p&gt;Learn FastAPI from the ground up. Build REST APIs, serve web pages with Jinja2 templates, and create a complete URL shortener project in Python.&lt;/p&gt;
        &lt;hr /&gt;
        
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
        
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: Python Game Development</title>
      <id>https://realpython.com/learning-paths/python-game-development/</id>
      <link href="https://realpython.com/learning-paths/python-game-development/"/>
      <updated>2026-04-16T12:00:00+00:00</updated>
      <summary>Build Python games from command-line projects to 2D graphical games with turtle, Tkinter, Pygame, and Arcade.</summary>
      <content type="html">
        &lt;p&gt;Build Python games from command-line projects to 2D graphical games with turtle, Tkinter, Pygame, and Arcade.&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>Learning Path: LLM Application Development With Python</title>
      <id>https://realpython.com/learning-paths/llm-application-development-python/</id>
      <link href="https://realpython.com/learning-paths/llm-application-development-python/"/>
      <updated>2026-03-19T12:00:00+00:00</updated>
      <summary>Build LLM-powered applications in Python. Call model APIs, craft prompts, add retrieval-augmented generation, create AI agents, and connect via MCP.</summary>
      <content type="html">
        &lt;p&gt;Build LLM-powered applications in Python. Call model APIs, craft prompts, add retrieval-augmented generation, create AI agents, and connect via MCP.&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>Learning Path: Python Coding With AI</title>
      <id>https://realpython.com/learning-paths/coding-with-ai/</id>
      <link href="https://realpython.com/learning-paths/coding-with-ai/"/>
      <updated>2025-12-07T12:00:00+00:00</updated>
      <summary>Use AI coding assistants to write, review, and debug Python code faster. Choose an editor-based assistant like Cursor or a terminal-based one like Claude Code, then make it part of your daily workflow.</summary>
      <content type="html">
        &lt;p&gt;Use AI coding assistants to write, review, and debug Python code faster. Choose an editor-based assistant like Cursor or a terminal-based one like Claude Code, then make it part of your daily workflow.&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>Learning Path: Ace Your Python Coding Interview</title>
      <id>https://realpython.com/learning-paths/python-interview/</id>
      <link href="https://realpython.com/learning-paths/python-interview/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Prepare for Python coding interviews with practice problems, tips for standing out, and resources from top PyCon talks and Python books.</summary>
      <content type="html">
        &lt;p&gt;Prepare for Python coding interviews with practice problems, tips for standing out, and resources from top PyCon talks and Python books.&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>Learning Path: Create Graphical User Interfaces (GUI)</title>
      <id>https://realpython.com/learning-paths/python-gui-programming/</id>
      <link href="https://realpython.com/learning-paths/python-gui-programming/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Build Python GUI applications with Tkinter, PyQt, wxPython, and Kivy. Learn layouts, event handling, threading, and database integration.</summary>
      <content type="html">
        &lt;p&gt;Build Python GUI applications with Tkinter, PyQt, wxPython, and Kivy. Learn layouts, event handling, threading, and database integration.&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>Learning Path: Python Data Structures</title>
      <id>https://realpython.com/learning-paths/basic-python-data-structures/</id>
      <link href="https://realpython.com/learning-paths/basic-python-data-structures/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Learn Python&#x27;s built-in data structures: strings, lists, tuples, dictionaries, sets, and bytes, plus sorting, copying, and comprehensions.</summary>
      <content type="html">
        &lt;p&gt;Learn Python&#x27;s built-in data structures: strings, lists, tuples, dictionaries, sets, and bytes, plus sorting, copying, and comprehensions.&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>Learning Path: Testing and Continuous Integration</title>
      <id>https://realpython.com/learning-paths/test-your-python-apps/</id>
      <link href="https://realpython.com/learning-paths/test-your-python-apps/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Learn how to test Python code with unittest, doctest, pytest, and mock objects. Set up continuous integration with GitHub Actions and Docker.</summary>
      <content type="html">
        &lt;p&gt;Learn how to test Python code with unittest, doctest, pytest, and mock objects. Set up continuous integration with GitHub Actions and Docker.&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>Learning Path: Exceptions, Logging, and Debugging</title>
      <id>https://realpython.com/learning-paths/exception-handling-logging-debugging/</id>
      <link href="https://realpython.com/learning-paths/exception-handling-logging-debugging/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Learn Python exception handling, logging, and debugging. Work with raise, built-in exceptions, the logging module, and pdb to write reliable code.</summary>
      <content type="html">
        &lt;p&gt;Learn Python exception handling, logging, and debugging. Work with raise, built-in exceptions, the logging module, and pdb to write reliable code.&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>Learning Path: Important Standard Library Modules</title>
      <id>https://realpython.com/learning-paths/standard-library-modules-you-should-know/</id>
      <link href="https://realpython.com/learning-paths/standard-library-modules-you-should-know/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Explore Python standard library modules including math, datetime, JSON, CSV, regex, subprocess, and argparse through hands-on tutorials and courses.</summary>
      <content type="html">
        &lt;p&gt;Explore Python standard library modules including math, datetime, JSON, CSV, regex, subprocess, and argparse through hands-on tutorials and courses.&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>
