Python

[ follow ]
Python
fromPythonbytes
17 hours ago

Inverted dependency trees

PEP 814 adds a built-in frozendict immutable mapping to Python to prevent unintended modifications and support reliable immutable dictionaries.
Python
fromPyImageSearch
1 day ago

Pushing Docker App to AWS ECR for Lambda Deployment Using AWS CLI - PyImageSearch

Configure AWS CLI, build and push a Docker image of a FastAPI ONNX inference app to AWS ECR for Lambda deployment.
Python
fromRealpython
1 day ago

How to Properly Indent Python Code - Real Python

Python uses indentation to define code blocks; follow PEP 8 by using four spaces per indentation level and rely on Python-aware editors.
fromTreyhunner
1 day ago

Python Black Friday & Cyber Monday sales (2025)

Python Morsels: I'm offering lifetime access for the second time ever (more details below) Data School: a new subscription to access all of Kevin's 7 courses plus all upcoming courses Talk Python: AI Python bundle, the Everything Bundle, and Michael's Talk Python in Production Reuven Lerner: get 20% off your first year of the LernerPython+data tier (code BF2025) : get 50% off all his books including his all books bundle (code BF202550) Mike Driscoll: get 50% off all his Python books and courses (code BLACKISBACK)
Python
fromMathspp
1 day ago

Generalising itertools.pairwise

itertools.pairwise is an iterable from the standard module itertools that lets you access overlapping pairs of consecutive elements of the input iterable. That's quite a mouthful, so let me translate: You give pairwise an iterable, like "ABCD", and pairwise gives you pairs back, like ("A", "B"), ("B", "C"), and ("C", "D"). In loops, it is common to unpack the pairs directly to perform some operation on both values.
Python
fromEuroPython Society
1 day ago

New Europython Society Fellow in 2025

Martin has been part of the Europython Conferences volunteers since 2017. Some have "met" him the first time in a response on an issue sent to the helpdesk or during the organisation meetings of the ops team.Others interacted with him as a volunteer at reception, out in the halls, a tutor in a Humble Data tutorial, a session chair, or room manager in a tutorial or talk.
Python
Python
fromTall, Snarky Canadian
3 days ago

Should I rewrite the Python Launcher for Unix in Python?

Pure Python can replace Rust for the Python Launcher for Unix because I/O-bound behavior keeps Python performance acceptable for practical use.
Python
fromdaniel.feldroy.com
3 days ago

TIL: Default code block languages for mkdocs

Set default_lang: python in mkdocs.yml using pymdownx.highlight so code blocks without language tags are highlighted as Python.
fromTreyhunner
3 days ago

Python Morsels Lifetime Access Sale

When you sign up for Python Morsels, you'll choose your current Python skill level, from novice to advanced. Based on your skill level, each Monday I'll send you a personalized routine with: a short screencast to watch (or read) a multi-part exercise to move you outside your comfort zone a mini exercise that you can accomplish in just 10 minutes links to dive deeper into subsequent screencasts and exercises
Python
#fastapi
fromRealpython
4 days ago
Python

Episode #275: Building a FastAPI Application & Exploring Python Concurrency - The Real Python Podcast

fromRealpython
4 days ago
Python

Episode #275: Building a FastAPI Application & Exploring Python Concurrency - The Real Python Podcast

Python
fromPython GUIs
6 days ago

First Steps With the DearPyGui Library for Desktop GUI Development

DearPyGui is a GPU-accelerated, cross-platform Python GUI framework offering modern widgets, themes, developer tools, and a clear app lifecycle for high-performance desktop interfaces.
Python
fromTall, Snarky Canadian
4 days ago

The varying strictness of TypedDict

TypedDict now controls both key requiredness and whether extra keys are allowed, with Python 3.15 adding closed TypedDict behavior to restrict unknown keys.
Python
fromTheregister
6 days ago

Rust edges toward CPython and older platforms won't like it

CPython maintainers propose integrating Rust gradually, starting with optional extensions and eventually requiring Rust across the CPython codebase.
#mcp
Python
fromRealpython
6 days ago

Build a Python MCP Client to Test Servers From Your Terminal Quiz - Real Python

Five-question quiz tests building a Python MCP client covering chat interface, AI handler initialization, runtime error handling, and command-line entry-point updates.
#open-source
#dataclasses
Python
fromRealpython
1 week ago

Break Out of Loops With Python's break Keyword - Real Python

The break statement immediately exits the innermost loop, stopping further iterations; continue skips the current iteration but does not exit the loop.
Python
fromPyImageSearch
4 weeks ago

Build a VLC Playlist Generator with SmolVLM for Video Highlight Tagging - PyImageSearch

A VLC Playlist Generator uses SmolVLM2 to detect video highlights and generate XSPF playlists for direct navigation in VLC.
#kv-cache
fromPyImageSearch
2 weeks ago

Converting a PyTorch Model to ONNX for FastAPI (Docker) Deployment - PyImageSearch

In this lesson, you will learn how to convert a pre-trained ResNetV2-50 model using PyTorch Image Models (TIMM) to ONNX, analyze its structure, and test inference using ONNX Runtime. We'll also compare inference speed and model size against standard PyTorch execution to highlight why ONNX is better suited for lightweight AI inference. This prepares the model for integration with FastAPI and Docker, ensuring environment consistency before deploying to AWS Lambda.
Python
fromPyImageSearch
1 month ago

Building a Streamlit Python UI for LLaVA with OpenAI API Integration - PyImageSearch

In this tutorial, you'll learn how to build an interactive Streamlit Python-based UI that connects seamlessly with your vLLM-powered multimodal backend. You'll write a simple yet flexible frontend that lets users upload images, enter text prompts, and receive smart, vision-aware responses from the LLaVA model - served via vLLM's OpenAI-compatible interface. By the end, you'll have a clean multimodal chat interface that can be deployed locally or in the cloud - ready to power real-world apps in healthcare, education, document understanding, and beyond.
Python
Python
fromNedbatchelder
1 week ago

Why your mock breaks later

Patch mocks where the object is used, not where it's defined, to avoid unintended, global effects on other libraries and test infrastructure.
fromMathspp
1 week ago

Floodfill algorithm in Python

ctx = canvas.getContext("2d") URL = "/blog/floodfill-algorithm-in-python/_python.txt" async def load_bitmap(url: str) -> list[list[int]]: # Fetch the text file from the URL response = await fetch(url) text = await response.text() bitmap: list[list[int]] = [] for line in text.splitlines(): line = line.strip() if not line: continue row = [int(ch) for ch in line if ch in "01"] if row: bitmap.append(row) return bitmap
Python
Python
fromMedium
2 weeks ago

How to activate virtual environment in python3

Use virtual environments to avoid pip 'externally-managed-environment' errors and prevent altering the system Python or other projects' dependencies.
Python
fromPythonbytes
1 week ago

Tapping into HTTP

Tools and techniques: httptap for detailed HTTP timing, Python performance hacks to speed code, and FastRTC for real-time Python audio/video streaming.
Python
fromInfoWorld
1 week ago

Python vs. Mojo (and Java, Go, Rust, and .NET)

Mojo, alternative data-science languages, Python dataclasses, and a new PyTorch-related distributed-processing framework are current focal points for Python practitioners.
Python
fromMicrosoft for Python Developers Blog
1 week ago

Python in Visual Studio Code - November 2025 Release - Microsoft for Python Developers Blog

Python extension November 2025 adds Copilot 'Add as docstring', localized hover summaries, Convert wildcard imports code action, and debugger support for multiple interpreters.
Python
fromPythonmorsels
1 week ago

Unnecessary parentheses in Python

Parentheses in Python serve three roles—calling callables, creating empty tuples, and grouping—while grouping can be optional, misplaced, or enable implicit line continuation.
Python
fromEfficient Coder
2 weeks ago

The Anatomy of a Scalable Python Project | EfficientCoder

Organize Python projects with a balanced folder structure, centralized config, fast tests, and predictable boundaries to scale code, team, environments, and speed.
Python
frompythontest.com
2 weeks ago

Explore Python dependencies with `pipdeptree` and `uv pip tree`

pipdeptree and uv pip tree reveal Python package dependency trees; pipdeptree runs with --python auto while uv pip tree integrates with uv-managed virtual environments.
fromdaniel.feldroy.com
2 weeks ago

Visiting Tokyo, Japan from November 12 to 24

I'm excited to announce that me and Audrey will be visiting Japan from November 12 to November 24, 2025! This will be our first time in Japan, and we can't wait to explore Tokyo. Yes, we'll be in Tokyo for most of it, near the Shinjuku area, working from coffee shops, meeting some colleagues, and exploring the city during our free time.
Python
Python
fromRealpython
2 weeks ago

Python Operators and Expressions - Real Python

Python operators enable computation and data manipulation using arithmetic, comparison, Boolean, identity, membership, bitwise, concatenation, repetition, and augmented assignment operators.
fromNedbatchelder
2 weeks ago

Three releases, one new organization

To measure your code, coverage.py needs to know what code got executed. To know that, it collects execution events from the Python interpreter. CPython now has two mechanisms for this: trace functions and sys.monitoring. Coverage.py has two implementations of a trace function (in C and in Python), and an implementation of a sys.monitoring listener. These three components are the measurement cores, known as "ctrace", "pytrace", and "sysmon".
fromThepythoncodingstack
2 weeks ago

The Misunderstood Hashable Types and Why Dictionaries Are Called Dictionaries * [Club]

Pick up a dictionary. No, not that one. The real dictionary you have on your bookshelf, the one that has pages made of paper, which you use to look up the meaning of English words. Or whatever other language. But let's assume it's an English dictionary. Now, look up zymology. I'll wait... Done? It probably didn't take you too long to find zymology.
Python
#python-314
Python
fromPythontest
1 month ago

Testing against Python 3.14 | PythonTest

Update projects to test against Python 3.14 and adjust local installs, tox, classifiers, and CI test matrices accordingly.
Python
fromPythonbytes
1 month ago

pi py-day (or is it py pi-day?)

Python 3.14 introduces PEP 750 and PEP 758, improved errors, a default interactive shell with syntax highlighting and autocompletion, and several tooling enhancements.
Python
fromRealpython
2 weeks ago

Episode #273: Advice for Writing Maintainable Python Code - The Real Python Podcast

Use clear comments, expressive names, avoid magic numbers, design for future changes, and adopt modern tooling (like Ruff) to make Python code maintainable and refactorable.
fromRealpython
2 weeks ago

Python MarkItDown: Convert Documents Into LLM-Ready Markdown - Real Python

The MarkItDown library lets you quickly turn PDFs, Office files, images, HTML, audio, and URLs into LLM-ready Markdown. In this tutorial, you'll compare MarkItDown with Pandoc, run it from the command line, use it in Python code, and integrate conversions into AI-powered workflows. By the end of this tutorial, you'll understand that: You can install MarkItDown with pip using the specifier to pull in optional dependencies.
Python
fromTreehouse Blog
2 weeks ago

From Excel to Python: A Beginner's Guide

Excel gives you a huge toolbox of functions ( SUM, IF, VLOOKUP, INDEX, etc.), but eventually, you hit a wall. Maybe you want to do something more custom than Excel allows. Maybe your file slows down with too many rows. Or maybe there simply isn't a built-in function for exactly what you need. Python solves this by letting you build your own custom functions. That's why it's so powerful for data analysis-it's Excel without limits.
Python
#__slots__
Python
The Python Software Foundation withdrew a $1.5M NSF grant proposal because funding conditions required denying support for diversity across all PSF activities.
#lazy-imports
Python
fromMathspp
2 weeks ago

A generator, duck typing, and a branchless conditional walk into a bar

Generators provide lazy evaluation in Python, enabling iterable objects like range to create values on demand and avoid upfront computation.
Python
fromMedium
1 month ago

From Chaos to Coordination: The Power of Multi AI Agent Systems with CrewAI

CrewAI uses multiple specialized AI agents organized into crews and processes to manage complex, multi-step projects more reliably than a single AI.
Python
fromPythonbytes
3 weeks ago

Gilded Python and Beyond

Cyclopts replaces Typer's proxy-default CLI design with annotations to fix usability issues, while Python 3.14's free-threaded interpreter reduces GIL-related penalties to about 5–10%.
Python
fromRealpython
3 weeks ago

Using Python Optional Arguments When Defining Functions Quiz - Real Python

Understand Python parameter handling: default values, mutable-default pitfalls, argument unpacking (*args/**kwargs), and using Boolean flags for clearer function calls.
Python
fromPythontest
4 weeks ago

Polite lazy imports for Python package maintainers | PythonTest

Minimize package import time by lazily loading subcomponents via __init__.py so importing the package doesn't load unused parts.
fromRealpython
3 weeks ago

Episode #272: Michael Kennedy: Managing Your Own Python Infrastructure - The Real Python Podcast

How do you deploy your Python application without getting locked into an expensive cloud-based service? This week on the show, Michael Kennedy from the Talk Python podcast returns to discuss his new book, "Talk Python in Production." Michael runs multiple Python applications online, including a training site, blog, and two podcasts. While searching for the best solution for hosting his business, he documented his findings in a book.
Python
Python
fromDEV Community
4 weeks ago

Scratching the Itch, Paying the Debt: How Community Keeps Legacy Open Source Projects Alive

FastKML and PyGeoIf grew from personal tools into widely used geospatial Python libraries that now need modernization due to technical debt and ecosystem changes.
Python
fromQuansight
3 weeks ago

Exploring & Improving the Thread Safety of NumPy's Test Suite

NumPy's test suite was improved for thread-safety to prepare for free-threaded Python by fixing tests, updating CI, and applying OSS practices.
Python
fromAntocuni
3 weeks ago

Inside SPy, part 1: Motivations and Goals - Antonio Cuni's blog

SPy is a statically typed Python variant combining an interpreter and compiler focused on performance, deliberately sacrificing full Python compatibility for optimization.
Python
fromPycon
3 weeks ago

PyCon US 2026 - Call for Proposals Now Open!

PyCon US 2026 will take place in Long Beach, CA, May 13–19, 2026, with the Call for Proposals and website now open.
Python
fromPythonmorsels
3 weeks ago

__dict__: where Python stores attributes

Python stores attributes for instances, classes, and modules in their __dict__ dictionaries, mapping attribute names to values.
Python
fromESPN.com
3 weeks ago

Nebraska's black alternate uniforms headline best Week 10 threads in college football

Nebraska will wear a monochromatic black uniform with a white helmet featuring a black "N" emblem when No. 23 USC visits in Week 10.
Python
fromMathspp
4 weeks ago

TIL 135 - Build the Python documentation

Fixing a single leading-space in a reStructuredText comment corrected a misrendered 'See also' callout in Python documentation.
Python
fromThepythoncodingstack
4 weeks ago

Impostors * How Even The Python Docs Get This Wrong* * [Club]

zip(), enumerate(), and range() are common Python loop tools; mastering them enables exploring itertools, and examples of range() in for loops can be misleading.
fromGrahamdumpleton
1 month ago

Detecting object wrappers - Graham Dumpleton

The best example of this and the reason that wrapt was created in the first place, is to instrument existing Python code to collect metrics about its performance when run in production. Since one cannot expect a customer for an application performance monitoring (APM) service to modify their code, as well as code of the third party dependencies they may use, transparently reaching in and monkey patching code at runtime is the best one can do.
Python
fromRubyflow
1 month ago

Resolving the 'rest_framework' Module Not Found Error

The ModuleNotFoundError: No module named 'rest_framework' is a common issue faced by developers working with Django REST Framework (DRF).
fromRealpython
1 month ago

What Can I Do With Python? Quiz - Real Python

How well do you know the different areas where Python shines? In this quiz, you'll revisit web apps and APIs, GUI apps, CLI tools, machine learning, and more. You'll also check what Python isn't suited for and which alternatives work better. Get ready to explore the wide scope of what you can do with Python.
Python
fromPythonbytes
1 month ago

It's some form of Elvish

caniscrape checks a website for common anti-bot mechanisms and reports: A difficulty score (0-10) Which protections are active (e.g., Cloudflare, Akamai, hCaptcha, etc.) What tools you'll likely need (headless browsers, proxies, CAPTCHA solvers, etc.) Whether using a scraping API might be better This helps you decide the right scraping approach before you waste time building a bot that keeps getting blocked.
Python
Python
fromReuven Lerner
1 month ago

Your personal mentor for Python and Pandas

LernerPython.com delivers structured, mentored Python, Pandas, and Git training with courses, exercises, live mentorship, community lectures, and member perks.
#wrapt
fromTalkpython
1 month ago

38 things Python developers should learn in 2025

Free-threaded CPython (PEP 703): A build mode that removes the GIL so CPU-bound threads can run in parallel. Expect ecosystem work to make C extensions safe here. (Python Enhancement Proposals (PEPs)) uv and uvx: A faster, modern installer and environment manager that makes "clean, repeatable" installs feel instant. (Astral Docs) Docker + Compose: Containers capture your app and its services so dev and prod stay in sync. (Docker Documentation)
Python
Python
fromThepythoncodingstack
1 month ago

Are Tuples More Like Lists or Strings? And Why We Don't Really Care * [Club]

Choose Python data types based on semantic meaning and intended usage, not superficial similarity; tuples serve different roles than lists or strings in code design.
fromhttps://daniel.feldroy.com
1 month ago

Using Asyncpg with FastAPI and Air

Asyncpg is the connector for PostgreSQL and asyncio-flavored Python. Here's how to use it without other libraries on FastAPI and Air projects. Recently I've been on a few projects using PostgreSQL where SQLAlchemy and SQLModel felt like overkill. Instead of using those libraries I leaned on writing SQL queries and running those directly in [asyncpg](https://pypi.org/project/asyncpg/) instead of using an ORM powered by asyncpg. Here's how I got it to work
Python
Python
fromPythonbytes
1 month ago

Python++

New Python ecosystem tools and projects include PyPI+ for package exploration, uv-ship for safer releases, performance analysis of Python 3.14, and the experimental Air framework.
Python
fromInfoWorld
1 month ago

7 newer data science tools you should be using with Python

Several lesser-known Python data-wrangling tools, including ConnectorX and DuckDB, enable faster, parallelized database loading and in-process OLAP analytics beyond Pandas/Numpy.
fromRealpython
1 month ago

Polars vs pandas: What's the Difference? Quiz - Real Python

Interactive Quiz ⋅ 10 QuestionsBy Ian Eyre
Python
fromThepythoncodingstack
1 month ago

Creating a Singleton Class in Python And Why You (Probably) Don't Need It

If you spend long enough in the programming world, you'll come across the term singleton at some point. And if you hadn't seen this term yet, well, now you have! In Python, you don't need singleton classes. Almost never. But creating one is a great exercise in understanding how Python creates objects. And discussing alternatives to a singleton class helps you explore other aspects of Python.
Python
fromRealpython
1 month ago

Python Descriptors - Real Python

Descriptors are a specific Python feature that power a lot of the magic hidden under the language's hood. If you've ever thought that Python descriptors are an advanced topic with few practical applications, then this video course is the perfect tool to help you understand this powerful feature. You'll come to understand why Python descriptors are such an interesting topic and discover the kinds of use cases where you can apply them.
Python
Python
fromMedium
1 month ago

If You Write Python, You Must Understand Asyncio

asyncio is Python's built-in library enabling asynchronous programming with async/await, allowing concurrent task progress during I/O waits.
Python
fromRealpython
1 month ago

How to Use Python: Your First Steps - Real Python

Python installs on Windows, macOS, and Linux, offers a readable syntax, built-in data types, error handling, interactive REPL, and tools to start programming effectively.
Python
fromRealpython
1 month ago

How to Use Python: Your First Steps Quiz - Real Python

Practice Python fundamentals—variables, keywords, strings, and error recognition—through an eight-question, untimed quiz with scored feedback.
fromStreamHacker
1 month ago

Monitoring Celery Tasks with Sentry

Sentry is a great tool for monitoring celery tasks, and alerting when they fail or don't run on time. But it requires a bit of work to setup properly. Below is some sample code for setting up sentry monitoring of periodic tasks, followed by an explanation. import math import sentry_sdk from celery import signals from sentry_sdk import monitor from sentry_sdk.integrations.celery import CeleryIntegration @signals.beat_init.connect # if you use beats @signals.celeryd_init.connect def init_sentry(**kwargs): sentry_sdk.init( dsn=..., integrations=[ CeleryIntegration(monitor_beat_tasks=False) ] ) @signals.worker_shutdown.connect @signals.task_postrun.connect def flush_sentry(**kwargs): sentry_sdk.flush(timeout=5) def add_periodic_task(celery, schedule, task): max_runtime = math.ceil(schedule * 4 / 60) monitor_config = { "recovery_threshold": 1, "failure_issue_threshold": 10, "checkin_margin": max_runtime, "max_runtime": max_runtime, "schedule": { "type": "interval", "value": math.ceil(schedule / 60.0) "unit": "minute" } } name = task.__name__ task = monitor(monitor_slug=name, monitor_config=monitor_config)(task) celery.add_periodic_task(schedule, celery.task(task).s(), name=name)
Python
Python
fromPythontest
1 month ago

Installing Python 3.14 on Mac or Windows | PythonTest

uv enables clean, convenient installation and management of multiple Python versions; python.org installers remain a simple choice for single-version users.
Python
fromTall, Snarky Canadian
1 month ago

Why it took 4 years to get a lock files specification

A lock file must unambiguously record where and how to obtain and install every dependency, handling source trees, sdists, wheels, specifiers, and dependency graphs.
Python
fromMicrosoft for Python Developers Blog
1 month ago

Python in Visual Studio Code - October 2025 Release - Microsoft for Python Developers Blog

October 2025 Python extensions for VS Code add Python Environments fixes, Copy Test ID testing workflow, and shell startup improvements for environment activation.
[ Load more ]