Python
Master Python programming with tutorials, libraries, and best practices
Navigate through content by publication date
Tue, Nov 17
18 items found
List missing osu! skin files with Python before you upload the .osk
A skin can look finished in screenshots and still ship without cursor.png, a whole hitsound set, or the @2x pair for a sprite you only exported in HD. osu! will not warn you; it falls back to the default skin or to silence. This article walks through a small Python script that compares a skin folder to a required-file list and prints what is missing. The script was run on a temporary folder in this environment so the output below is real, not sketched. What the script checks A sh...
My AI-written code detector judged Python with a JavaScript model: lessons from building one for interviews
An AI-written code detector can look like it's working while it checks your code with the wrong model. Master the Interview, an AI technical interviewer I built (source), labels a candidate's code as AI- or human-written. Reviewing it later, I found its API scored Python and Java with the models trained on JavaScript. The cause was one block at the end of the training script. It raised no error, and the output still looked confident. Its line-by-line evidence was partly made up by the code it...
Upgrade One Dependency or Bump Them All?
Download your free Python Cheat Sheet here: https://realpython.com/cheatsheet Free Python Skill Test with instant level + learning plan: https://realpython.com/skill-test Want to learn faster? Become a Python Expert with unlimited access to 5,000+ tutorials, videos, and exercises: https://realpython.com/start Listen to the full episode at https://realpython.com/podcasts/rpp/231 or wherever you get podcasts -- with Chris Trudeau (hosted by Chris Bailey). 🐍 Become a Python expert with real-wo
rules_pycross - Bazel + Python rules for cross-platform external dependencies
Bazel + Python rules for cross-platform external dependencies This Starlark project has 98 stars and 53 forks on GitHub. Topics: bazel, bazel-rules, python.
Python Breakpoint: How to Use It in pdb
Inspecting a Python program at a chosen point starts with pausing execution there. Python’s breakpoint() function pauses at its call site and opens the configured debugger, which uses pdb by default. This article shows how to use pdb to check a value before continuing the program. TL;DR: Python breakpoint() Python’s breakpoint() pauses execution and opens […]
Python String isalnum() Function
Choosing a test for a Python string starts with deciding which characters it may contain. Python’s str.isalnum() returns True when a nonempty string contains only alphabetic or numeric characters. I’ll show how to test a complete string with str.isalnum() and choose a numeric-specific check when the input must represent a number. TL;DR: Choose the Check […]
Python Logging Module: How to Log to Console and File
Runtime messages help show what a Python program is doing as it runs. Python’s built-in logging module records those events by severity and routes them to destinations such as the console or a file. This article shows how to configure console and file output and use named loggers across modules. TL;DR: Python Logging Module Use […]
Python Stack: How to Use Lists and Deques
When you are adding last-in, first-out processing to a Python program, you need a container that keeps the newest item at the top. A list or deque can serve as a stack when you add and remove items at the same end. This article explains how to create a stack with a list and what […]
isalpha in Python: String Letter Check
When you check whether a text value contains only letters, you need a clear rule for every character in it. Python’s isalpha() method returns True when a nonempty string consists entirely of Unicode letters. This article shows how to call isalpha() and how empty strings or combining marks affect its result. TL;DR: Check Letters with […]
Python Insider: XTM Transifex sponsors Python’s documentation translations
XTM Transifex is supporting Python’s documentation translation teams with a year of free access to its Growth plan.
Django Weblog: 2027 DSF Board Nominations
The Django Software Foundation is inviting nominations for its 2027 Board of Directors. Five of the seven Board positions are open for election this year. The Board of Directors play a central role in the Foundation's work, overseeing its governance, fundraising, marketing, and outreach, and supporting Django events and initiatives across the globe. Directors serve staggered two-year terms. Nominations are open to all. You do not need to be a DSF member or have previous Board experience to ap...
Graham Dumpleton: Muru: scaling to zero
The last post was about a busy release, and what the Muru daemon does when requests start to wait. The opposite problem is just as common. A server hosting a dozen small sites, a few preview deployments and a staging copy or two will spend most of its time with nearly all of them idle, and each one sitting there with its workers started is holding memory nobody is using. Most Python web servers don't do anything about this. Gunicorn, uvicorn and granian keep the workers they started for as lo...
Quiz: Understanding Python Namespace Packages
In this quiz, you’ll test your understanding of Understanding Python Namespace Packages. By working through this quiz, you’ll revisit what namespace packages are, how they differ from regular packages, and why they’re a good fit for large collections of related packages. You’ll also review how Python combines same-named folders into one namespace, how to configure uv to build a namespace package, and how to publish its members to TestPyPI and install them independently...
Python Bindings: Calling C or C++ From Python
Are you a Python developer with a C or C++ library you’d like to use from Python? If so, then Python bindings allow you to call functions and pass data from Python to C or C++, letting you take advantage of the strengths of both languages. Throughout this tutorial, you’ll see an overview of some of the tools you can use to create Python bindings. In this tutorial, you’ll learn about: Why you want to call C or C++ from Python How to pass data between C and Python What tools and methods can he...
Find open SAM.gov small-business set-aside bids, sorted by response deadline, in a CSV (Python, no API key)
Article type: How-to guide (one task: list the open SAM.gov bids set aside for small businesses, sorted by response deadline, in a CSV) Prerequisites: Python 3.9 or later with requests (pip install requests), and about 250 MB of free disk space. No SAM.gov API key or account: the file is public. An Apify account only if you use the hosted version at the end. Tested on: 17 November 2026, against SAM.gov's public Contract Opportunities extract dated 17 November 2026. Your business qualifies...
Kiểm tra dữ liệu chứng chỉ trong file CSV bằng Python: ngày hợp lệ và trạng thái hiệu lực
Khi quản lý một danh sách giấy chứng nhận hay chứng chỉ trong file CSV, lỗi hay gặp nhất không nằm ở logic phức tạp mà ở dữ liệu: ô ngày để trống, ngày không tồn tại, ngày hết hạn đứng trước ngày cấp. Bài này viết một đoạn Python nhỏ, chỉ dùng thư viện chuẩn, để đọc CSV, kiểm tra từng dòng và phân loại trạng thái hiệu lực. Mã đã chạy thử trên Python 3.12. Bài toán Mỗi dòng gồm họ tên, tên chứng chỉ, ngày cấp và ngày hết hạn (có thể để trống nếu chứng chỉ không ghi thời hạn). Ta mu...
Audit Image Weight Across Your Sitemap with Python (Standard Library Only): Oversized Images, Missing Width/Height, Lazy Loading, CSV Report
Image weight creeps up quietly. Someone uploads a 3000 pixel PNG straight from a design tool and the CMS shows it at 600 pixels wide. A theme update adds loading="lazy" to every image, including the hero at the top of the page. A gallery block drops the width and height attributes, so the text jumps down as each photo arrives. None of this breaks a page. It just makes it slower and jumpier, one upload at a time. This post builds an image weight auditor in Python using only the standard libra...
De una API meteorológica a un tablero público con dbt y DuckDB
¿Cómo cambia la precipitación a lo largo del año entre Tacna, Lima y Piura? Para explorarlo construimos Clima Perú, un pipeline que toma datos meteorológicos diarios de 2025, los transforma con SQL y publica un tablero junto con el CSV de resultados. Ver el tablero · Explorar el repositorio · Ver el workflow De la API al modelo diario Python consulta el archivo histórico de Open-Meteo una vez por ciudad. Pedimos la temperatura máxima y mínima a dos metros, y la precipitación acum...