
Episode 74
Python's Assignment Expressions and Fixing a Botched Release to PyPI
The Real Python Podcast · Real Python
August 20, 202158m 1s
Audio is streamed directly from the publisher (dts.podtrac.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.
Show Notes
<p>Have you started to use Python’s assignment expression in your code? Maybe you have heard them called the walrus operator. Now that the controversy over the introduction in Python 3.8 has settled down, how can you use assignment expressions effectively in your code? This week on the show, David Amos is back, and he’s brought another batch of PyCoder’s Weekly articles and projects.</p>
<p>David shares a recent article by previous guest Brett Cannon about what to do if you botch a release to PyPI. It’s a valuable resource to keep bookmarked for when things go sideways. We also talk about a recent project by Brett, a Python launcher for Unix based operating systems.</p>
<p>We cover several other articles and projects from the Python community including, a Python framework with a built-in database and authorization support from Replit, do coders learn how to use entire libraries just from the documentation, how to use <code>sleep()</code> to code a Python uptime bot, monitor your home’s temperature and humidity with Raspberry Pis and Prometheus, and a fast Settlers of Catan Python implementation with a strong AI player.</p>
<div class="alert alert-primary" role="alert">
<p><strong>Course Spotlight:</strong> <a href="https://realpython.com/courses/python-sleep-uptime-bot/">Using sleep() to Code a Python Uptime Bot</a> </p>
<p>In this course, you’ll learn how to add time delays to your Python programs. You’ll use the built-in time module to add Python sleep() calls to your code. To practice, you’ll use time.sleep() when making an uptime bot that checks whether a website is still live.</p>
</div>
<p>Topics:</p>
<ul>
<li>00:00:00 – Introduction</li>
<li>00:02:43 – The Walrus Operator: Python 3.8 Assignment Expressions</li>
<li>00:12:41 – Replit.web: Python Framework With Built-in Database and Auth</li>
<li>00:16:55 – Sponsor: Gather</li>
<li>00:17:39 – Do Coders Learn How to Use Entire Libraries Just From the Docs?</li>
<li>00:26:15 – Using sleep() to Code a Python Uptime Bot</li>
<li>00:31:53 – Monitor Home Temperature and Humidity With Raspberry Pis and Prometheus</li>
<li>00:39:51 – Video Course Spotlight</li>
<li>00:40:57 – What to Do When You Botch a Release on PyPI</li>
<li>00:47:25 – catanatron: Fast Settlers of Catan Python Implementation</li>
<li>00:50:37 – python-launcher: Python Launcher for Unix</li>
<li>00:56:59 – Thanks and goodbye</li>
</ul>
<p>Show Links:</p>
<p><a href="https://realpython.com/python-walrus-operator/">The Walrus Operator: Python 3.8 Assignment Expressions</a> – In this tutorial, you’ll learn about assignment expressions and the walrus operator. The biggest change in Python 3.8 was the inclusion of the <code>:=</code> operator, which you can use to assign variables in the middle of expressions. You’ll see several examples of how to take advantage of this new feature.</p>
<p><a href="https://blog.replit.com/replit-web">Replit.web: A Python Framework With Built-in Database and Auth Support</a> – The folks over at replit have released a new Python web framework with built-in authentication and database support and, more interestingly, hosting. In a few lines of code, you can have a Python web app connected to a database, authenticating users, and hosted on replit. This could be a great tool for quickly building and hosting prototypes or experimental projects.</p>
<p><a href="https://old.reddit.com/r/learnpython/comments/osrlfc/do_coders_really_learn_how_to_use_entire/">Do Coders Really Learn How to Use Entire Libraries Just From the Documentation?</a> – How do <em>you</em> learn a new library? Do you start with the docs? What do you do if the documentation is lacking? Or do you first search for video lessons or written tutorials?</p>
<p><a href="https://realpython.com/courses/python-sleep-uptime-bot/">Using sleep() to Code a Python Uptime Bot</a> – Learn how to add time delays to your Python programs. You’ll use the built-in time module to add Python <code>sleep()</code> calls to your code. To practice, you’ll use <code>time.sleep()</code> when making an uptime bot that checks whether a website is still live.</p>
<p><a href="https://opensource.com/article/21/7/home-temperature-raspberry-pi-prometheus">Monitor Your Home’s Temperature and Humidity With Raspberry Pis and Prometheus</a> – Do you enjoy collecting and analyzing data, or are you looking for a fun project to improve your data skills? Do you also enjoy tinkering with hardware? Then this project might be a fun one for you to check out! Learn how to set up a RaspberryPi using <a href="https://github.com/prometheus/prometheus">Prometheus</a> to collect and monitor temperature sensor data.</p>
<p><a href="https://snarky.ca/what-to-do-when-you-botch-a-release-on-pypi/">What to Do When You Botch a Release on PyPI</a> – Mistakes happen to everyone. But what do you do if you make a mistake when releasing a package to PyPI? Don’t panic! There are a number of things you can do to fix a bad release. This article walks you through several scenarios and suggested solutions.</p>
<p>Projects:</p>
<ul>
<li><a href="https://github.com/bcollazo/catanatron">catanatron: Fast Settlers of Catan Python Implementation and Strong AI Player</a></li>
<li><a href="https://github.com/brettcannon/python-launcher">python-launcher: Python Launcher for Unix</a></li>
</ul>
<p>Additional Links:</p>
<ul>
<li><a href="https://realpython.com/python-sleep/">Python sleep(): How to Add Time Delays to Your Code: Real Python Article</a></li>
<li><a href="https://realpython.com/python38-new-features/">Cool New Features in Python 3.8: Real Python Article</a></li>
<li><a href="https://www.python.org/dev/peps/pep-0572/">PEP 572 – Assignment Expressions: Python.org</a></li>
<li><a href="https://github.com/prometheus/prometheus">Prometheus</a></li>
<li><a href="https://opensource.com/article/21/7/temperature-sensors-pi">Set up temperature sensors in your home with a Raspberry Pi: Opensource.com</a></li>
<li><a href="https://opensource.com/article/21/7/run-prometheus-home-container">Run Prometheus at home in a container: Opensource.com</a></li>
<li><a href="https://pimylifeup.com/raspberry-pi-humidity-sensor-dht22/">Raspberry Pi Humidity Sensor using the DHT22: PiMyLifeUp</a></li>
<li><a href="https://realpython.com/podcasts/rpp/47/">Episode 47: Unraveling Python’s Syntax to Its Core With Brett Cannon</a></li>
<li><a href="https://realpython.com/podcasts/rpp/43/">Episode 43: Deep Reinforcement Learning in a Notebook With Jupylet + Gaming and Synthesis</a></li>
</ul>
<p>Level up your Python skills with our expert-led courses:</p>
<ul>
<li><a href="https://realpython.com/courses/how-to-publish-your-own-python-package-pypi/">How to Publish Your Own Python Package to PyPI</a></li>
<li><a href="https://realpython.com/courses/cool-new-features-python-38/">Cool New Features in Python 3.8</a></li>
<li><a href="https://realpython.com/courses/python-sleep-uptime-bot/">Using sleep() to Code a Python Uptime Bot</a></li>
</ul> <p><a rel="payment" href="https://realpython.com/join">Support the podcast & join our community of Pythonistas</a></p>