CTRL-C, Exceptions, Ruff Speed-up, and More

#626 โ€“ APRIL 23, 2024 VIEW IN BROWSER
The PyCoder’s Weekly Logo
Asyncio Handle Control-C (SIGINT)
When the user presses CTRL-C on the keyboard, the OS raises an interrupt signal to your program. When writing concurrent code this can get complicated as the signal goes to the process. This article shows you how to handle capturing CTRL-C elegantly when using asyncio.
JASON BROWNLEE

Using raise for Effective Exceptions
In this video course, you’ll learn how to raise exceptions in Python, which will improve your ability to efficiently handle errors and exceptional situations in your code. This way, you’ll write more reliable, robust, and maintainable code.
REAL PYTHON course

Securing Python and Open Source Ecosystems
Join this fireside chat featuring Dustin Ingram, Fellow at the Python Software Foundation (PSF), as we discuss trust and security for PyPI and other repositories in light of recent attacks, and initiatives such as Trusted Publishing - Tune in this Thursday! โ†’
ACTIVESTATEsponsor

Ruff Gets a Big Speed-Up
Ruff has changed from a generated parser to a hand-written recursive descent parser in the latest release. This has resulted in >2x speedup in its linting performance. This article covers what has changed and why they did it.
DHRUV MANILAWALA

Quiz: Managing Multiple Python Versions With pyenv
REAL PYTHON


Articles & Tutorials


OpenStreetMaps, Overpass API and Python
OpenStreetMaps (OSM) is an an open source mapping project that allows people to browse the world map and to plan routes. Not only does it have the expected web interface, but it also has an API known as Overpass. This article shows you two ways to use Python to query Overpass.
JUDITH VOCKENROTH

Python Gotcha: strip Can Remove More Than Expected
The Python strip, lstrip, and rstrip functions can have unexpected behavior: they strip a list of characters, not strings. Even though this is documented, it can lead to unexpected results. This post explains what happens and shows you two functions to use instead.
ANDREW WEGNER

Decoupling Systems to Get Closer to the Data
What are the benefits of using a decoupled data processing system? How do you write reusable queries for a variety of backend data platforms? This week on the show, Phillip Cloud, the lead maintainer of Ibis, will discuss this portable Python dataframe library.
REAL PYTHON podcast

Announcing py2wasm: A Python to Wasm Compiler
Wasmer, a company that builds Wasm tools, has announced py2wasm which converts your Python programs to WebAssembly, running at 3x faster speeds than direct Wasm. This post introduces you to the tool and shows how they took advantage of the Nuitka library.
SYRUS AKBARY

How to Format Floats Within F-Strings in Python
In this tutorial, you’ll learn how to use Python format specifiers within an f-string to allow you to neatly format a float to your required precision. You’ll also learn how to extract digits from existing strings and format them as well.
REAL PYTHON

Memory Management in mpmetrics
The mpmetrics library contains tools for determining runtime metrics on your code. To do this it requires some esoteric memory management techniques normally not undergone in Python. This post describe what they’ve done and why.
TRENDS BLOG

The Time Complexities Python Data Structures in Python
Big O notation describes the relationship between an algorithm, how much data it is using, and the time it takes to run. This article covers the time complexities of a variety of Python data structures.
TREY HUNNER

Django Project on NGINX Unit
Unit is a web server developed by the NGINX folks with pluggable support for Python using WSGI and ASGI. Aidas tried it out and this post talks about how he got some Django code working on this server.
AIDAS BENDORAITIS

I Asked 100 Devs Why They Aren’t Shipping Faster?
Daksh asked 100 developers why they aren’t shipping faster and this blog post shares what he learned. Problems include dependency bugs, overly complicated code bases, waiting on requirements, and more.
DAKSH GUPTA

Shape Typing in Python
This quick blog post shows you how to use Python type checking to ensure the dimensions of matrices being multiplied together. Typing is no longer just “is it an integer”.
JAMES FISHER

Software Needs to Be More Expensive
Open source is free, and although that is a good thing, it also means companies get to take without giving back. This opinion piece talks about how that should change.
GLYPH LEFKOWITZ


Projects & Code


Brought to you by Real Python for Teamssponsor
Online Python training created by a community of experts. Give your team the real-world Python skills they need to succeed โ†’

Master Python With Spaced Repetition
PYTHON CARDS

automathon: Simulate and Visualize Finite Automata
GITHUB.COM/ROHAQUINLOP

stamina: Production-Grade Retries for Python
GITHUB.COM/HYNEK

tenacity: Retrying Library for Python
GITHUB.COM/JD

auto_venv: Say Goodbye to Manual Setup or Install
GITHUB.COM/AMAL-KHAILTASH

escaping: Suppress Exceptions With Callbacks and Logs
GITHUB.COM/POMPONCHIK โ€ข Shared by Evgeniy Blinov

๐Ÿ“†๐Ÿ Upcoming Python Events


Weekly Real Python Office Hours Q&A (Virtual)
April 24, 2024

SPb Python Drinkup
April 25, 2024

Django Girls Ekpoma Workshop
April 26 to April 28, 2024

Open Source With Python
April 27, 2024

PythOnRio Meetup
April 27, 2024

Launching Python Niger
April 28 to April 29, 2024
Happy Pythoning!
Copyright ยฉ 2024 PyCoder’s Weekly, All rights reserved.
You are receiving this email because you opted in on our website at pycoders.com
Our mailing address: DevCademy Media Inc. ยท #720-999 West Broadway, Vancouver BC V5Z 1K5, Canada

Unsubscribe | Update Email Address

Older messages

Pydantic, Web Security, State of Python, and More

Tuesday, April 16, 2024

Pydantic: Simplifying Data Validation in Python #625 – APRIL 16, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Pydantic: Simplifying Data Validation in Python Discover the power of Pydantic,

Inline Dependencies, pipx, Multiplying Sequences, and More

Tuesday, April 9, 2024

Install and Execute Python Applications Using `pipx` #624 – APRIL 9, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Install and Execute Python Applications Using pipx In this tutorial, you'll

WAV Files, Reflex, Autopilot, and More

Tuesday, April 2, 2024

Reading and Writing WAV Files in Python #623 – APRIL 2, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Reading and Writing WAV Files in Python In this tutorial, you'll learn how to work with

Space Invaders, Using help(), Every Dunder Method, and More

Tuesday, March 26, 2024

Build a Python Turtle Game: Space Invaders Clone #622 – MARCH 26, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Build a Python Turtle Game: Space Invaders Clone In this step-by-step tutorial, you

Seaborn, Pointers, Memory, and More

Tuesday, March 19, 2024

Visualizing Data in Python With Seaborn #621 – MARCH 19, 2024 VIEW IN BROWSER The PyCoder's Weekly Logo Visualizing Data in Python With Seaborn In this tutorial, you'll learn how to use the

You Might Also Like

Software Testing Weekly - Issue 218

Friday, May 3, 2024

Unit, Integration and End-to-End Tests 🔧 View on the Web Archives ISSUE 218 May 4th 2024 COMMENT Welcome to the 218th issue! I loved going through this discussion among software engineers: What is your

gpt2-chatbot and OpenAI search engine - Weekly News Roundup - Issue #465

Friday, May 3, 2024

Plus: Med-Gemini; Vidu - Chinese answer to OpenAI's Sora; the first race of Abu Dhabi Autonomous Racing League; deepfaking celebrities to teach math and physics; and more! ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

NASA comes to the rescue of crowded rocket launch sites

Friday, May 3, 2024

Plus: Fisker's legal woes and Sprinklr lays off 100 View this email online in your browser By Christine Hall Friday, May 3, 2024 Good afternoon, and welcome to TechCrunch PM. We made it to Friday,

🎮 Forget the PS5 Pro, I Still Love My PS4 — The Best Lock Screen Widgets for iPhone

Friday, May 3, 2024

Also: Smart Home Mistakes to Avoid, and More! How-To Geek Logo May 3, 2024 Did You Know Half of the world's geysers are located in Yellowstone National Park. 🔑 More Passkeys Happy Friday! You can

JSK Daily for May 3, 2024

Friday, May 3, 2024

JSK Daily for May 3, 2024 View this email in your browser A community curated daily e-mail of JavaScript news The Power of React's Virtual DOM: A Comprehensive Explanation Modern JavaScript

Musk raises $6B for AI startup

Friday, May 3, 2024

Also, is TikTok dodging Apple's commissions? View this email online in your browser By Haje Jan Kamps Friday, May 3, 2024 Welcome to Startups Weekly — Haje's weekly recap of everything you can

SWLW #597: Seek first to understand, The "Iterative Adjacent Possible", and more.

Friday, May 3, 2024

Weekly articles & videos about people, culture and leadership: everything you need to design the org that makes the product. A weekly newsletter by Oren Ellenbogen with the best content I found

iOS Dev Weekly - Issue 659

Friday, May 3, 2024

Is Swift 6 hitting one of the REAL hard problems? Not generics, not data race safety, but naming things! 😬 View on the Web Archives ISSUE 659 May 3rd 2024 Comment Naming things is one of the two hard

Daily Coding Problem: Problem #1430 [Easy]

Friday, May 3, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Facebook. You have a large array with most of the elements as zero. Use a more space-

Making sense of product management

Friday, May 3, 2024

​ Getting a sense of product sense Whenever I hear the term product sense, I think back to a Seinfeld episode about write-offs (with a little artistic license). Jerry: “You don't even know what