#python

[ follow ]
#mcp
fromRealpython
1 day ago
Python

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

Build a minimal MCP client in Python to connect via stdio, list server capabilities, and use server tools with OpenAI for AI-powered chat.
fromTalkpython
1 week ago
Python

MCP Servers for Python Devs

Model Context Protocol (MCP) enables a single Python service to expose tools and data across editors and agents with practical transports and enterprise-grade authorization.
Python
fromRealpython
1 day 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.
#dataclasses
Python
fromRealpython
2 days 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.
fromMathspp
3 days 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
1 week 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.
#unittest
Python
fromInfoWorld
6 days 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.
Fundraising
fromPython Software Foundation Blog
1 week ago

Python is for everyone: Join in the PSF year-end fundraiser & membership drive!

The PSF funds and supports Python's community and infrastructure through donations, memberships, events, and services to keep Python strong, sustainable, and inclusive.
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.
fromEfficient Coder
1 week ago

Tired of Pip and Venv? Meet UV, Your New All-in-One Python Tool | EfficientCoder

Well, I've been playing with a new tool that's been gaining a ton of steam, and honestly? I don't think I'm going back. It's called UV, and it comes from Astral, the same team behind the super-popular linter, ruff. The goal here is ambitious. UV wants to be the single tool that replaces pip, venv, pip-tools, and even pipx. It's an installer, an environment manager, and a tool runner all rolled into one. And because it's written in Rust, it's ridiculously fast.
fromdaniel.feldroy.com
1 week 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
1 week 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.
Software development
fromThe JetBrains Blog
1 week ago

Rust vs. Python: Finding the right balance between speed and simplicity | The RustRover Blog

Choose Python for rapid development, accessibility, and data science; choose Rust for high-performance, safe, concurrent systems and long-term reliability.
Web development
fromThe JetBrains Blog
2 weeks ago

10 Smart Performance Hacks For Faster Python Code | The PyCharm Blog

Optimize Python with efficient data structures, low-level techniques, profiling, and benchmarks to significantly reduce performance bottlenecks and speed execution.
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
Python
fromPythonmorsels
2 weeks ago

__slots__ for optimizing classes

Using __slots__ removes the per-instance __dict__, restricts allowed attributes, and improves memory usage and attribute access speed.
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.
#lazy-imports
Software development
fromRealpython
2 weeks ago

Building UIs in the Terminal With Python Textual - Real Python

Textual is a Python framework for building interactive, visually appealing, and efficient terminal-based user interfaces using widgets, layouts, styling, and events.
Python
fromPythontest
3 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.
Python
fromRealpython
2 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.
fromTheregister
3 weeks ago

Python Foundation rejects $1.5M grant with no-DEI strings

These terms included affirming the statement that we 'do not, and will not during the term of this financial assistance award, operate any programs that advance or promote DEI [diversity, equity, and inclusion], or discriminatory equity ideology in violation of Federal anti-discrimination laws,' Crary noted.
Non-profit organizations
fromWill's Blog
3 weeks ago

Open Source Project Maintenance 2025

Every October, I do a maintenance pass on all my projects. At a minimum, that involves dropping support for whatever Python version is no longer supported and adding support for the most recently released Python version. While doing that, I go through the issue tracker, answer questions, and fix whatever I can fix. Then I release new versions. Then I think about which projects I should deprecate and figure out a deprecation plan for them.
#__dict__
fromThepythoncodingstack
2 weeks ago

And Now You Know Your ABC

Here's the task. I want to create a class to represent a track and field event held in a competition. This entry allows you to enter the raw results as reported by the officials-the athlete's bib number and the time they clocked in a race. It then computes the event's full results. There's more we could add to make this class more complete. But I won't. You can create a list of athletes that are competing in the track and field meeting:
Running
Python
fromThepythoncodingstack
3 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.
fromRubyflow
3 weeks 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
4 weeks 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
#pandas
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.
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
Books
fromTalkpython
1 month ago

Talk Python in Production Story

A decade-long website growth produced many features and users; a detailed account explains production lessons and how those differ from typical Python DevOps practices.
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.
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.
Python
fromPeterbe
1 month ago

In Python, you have to specify the type and not rely on inference - Peterbe.com

TypeScript infers literal argument types causing compile-time errors for mismatched values; Python's mypy requires explicit annotations to report the same mismatches.
Software development
fromTalkpython
1 month ago

Data Sci Tips and Tricks from CodeCut.ai

Micro-sized, practical Python and data-science snippets plus modern tools and disciplined configuration accelerate reproducible workflows and reduce friction for day-to-day data work.
#functions
#ruff
#string-formatting
fromRealpython
1 month ago

Episode #268: Advice on Beginning to Learn Python - The Real Python Podcast

What's changed about learning Python over the last few years? What new techniques and updated advice should beginners have as they start their journey? This week on the show, Stephen Gruppetta and Martin Breuss return to discuss beginning to learn Python. We share techniques for finding motivation, building projects, and learning the fundamentals. We provide advice on installing Python and not obsessing over finding the perfect editor. We also examine incorporating LLMs into learning to code and practicing asking good questions.
Python
#animal-rescue
fromPythonmorsels
1 month ago

Why splitlines() instead of split("\n")?

Let's say we have some text that was retrieved from a database, and the original text came from a form submission in a web browser. Web browsers often represent line breaks as a carriage return character, followed by a line feed character: That's what we see in our text as well: \r followed by \n. This is often called CRLF (carriage return and line feed) whereas \n is called LF (line feed).
Python
Software development
fromZero To Mastery
1 month ago

[September 2025] Python Monthly Newsletter | Zero To Mastery

September 2025 Python updates highlight a new documentary, authoritative language rankings, type checker evaluations, feature flag guidance, and REPL customization in Python 3.14.
Python
fromBeauty-of-imagination
1 month ago

Abusing yahi -a log based statistic tool a la awstats- to plot histograms/date series from CSV

Yahi is a pip-installable Python module that builds a single static HTML page to aggregate and analyze logs (including CSV) using regex-based parsing and aggregations.
Software development
fromMicrosoft for Python Developers Blog
1 month ago

Simplifying Resource Management in mssql-python through Context Manager - Microsoft for Python Developers Blog

mssql‑python adds context manager support for connections and cursors, enabling automatic resource cleanup and safer, cleaner SQL Server and Azure SQL interactions in Python.
Artificial intelligence
fromNature
1 month ago

Python, the movie! The origin story of the programming language comes to the silver screen

NumPy standardized numeric array handling in Python, enabling scientific computing and AI and driving widespread adoption of Python for numerical and data-science libraries.
#machine-learning
fromThe JetBrains Blog
1 month ago
Python

Why Is Python So Popular in 2025? | The PyCharm Blog

Python remains a widely used, versatile language in 2025, powering AI, machine learning, data workflows, and scalable production systems across developer experience levels.
fromData School
2 months ago
Books

Book preview: Master Machine Learning with scikit-learn

Master Machine Learning with scikit-learn is a near-complete book adapting a four-year course to train novices into skilled practitioners; first three chapters available for download.
Python
fromPycoders
1 month ago

PyCoder's Weekly | Issue #701

Multiple Python-related tools, events, and updates cover converting Python to LaTeX, MCP considerations, Playwright testing techniques, and recent Python and Django releases.
Python
fromRealpython
1 month ago

Strip Characters From a Python String - Real Python

Use Python's .strip(), .lstrip(), .rstrip() to remove whitespace or specified characters from string ends; use .removeprefix()/.removesuffix() for exact sequences.
Python
fromRealpython
1 month ago

Strip Characters From a Python String Quiz - Real Python

Use strip, lstrip, and rstrip to remove whitespace or specified characters from string ends and choose the appropriate method for the desired trimming.
Python
fromCreative Bloq
1 month ago

Think you've seen the weirdest place to play DOOM? Think again

DOOM can be run and played inside Blender by rendering the game to an icon using Doomviz and custom icon-scaling, caching, and input handling.
#fastapi
fromRealpython
1 month ago
Web frameworks

Get Started With FastAPI - Real Python

FastAPI provides a fast, developer-friendly Python web framework using type hints for automatic validation, serialization, interactive docs, and built-in features that reduce API boilerplate.
fromThe JetBrains Blog
2 months ago
Web frameworks

The Most Popular Python Frameworks and Libraries in 2025 | The PyCharm Blog

FastAPI is a modern, high-performance, type-safe, asynchronous Python framework ideal for building fast APIs and deploying ML models with auto-generated documentation.
Python
fromThepythoncodingstack
1 month ago

The Networking Event (#4 in The itertools Series * `combinations()` and `permutations()`)

Generate round-robin one-to-one meeting rotas from a list of participant names for pairwise networking.
Python
fromRealpython
2 months ago

What Can You Do With Python? Quiz - Real Python

Python can be used across web development, CLIs, TUIs, GUIs, data work, and robotics, and learners can assess knowledge with an interactive quiz.
#repl
#type-hints
#asyncio
Python
fromInfoWorld
2 months ago

Making good choices: How to get the best from Python tools

Leverage Python's strengths and avoid its pitfalls to excel in AI development using tools like uv run and SQL-free chatbot libraries.
fromGrahamdumpleton
2 months ago

Status of wrapt (September 2025) - Graham Dumpleton

Back then, constructing decorators using function closures had various short comings and the resulting wrappers didn't preserve introspection and various other attributes associated with the wrapped function. Many of these issues have been resolved in updates to Python and the functools.wraps helper function, but wrapt based decorators were still useful for certain use cases such as being able to create a decorator where you could work out whether it was applied to a function, instance method, class method or even a class.
fromRealpython
2 months ago

Sorting Dictionaries in Python: Keys, Values, and More Quiz - Real Python

This quiz helps you practice sorting dictionaries by keys, values, and custom rules in modern Python. You'll revisit how insertion order works, when to use different views, and how to rebuild sorted dictionaries. You'll also learn best practices for sorting dictionaries efficiently. For a complete overview, check out Sorting Dictionaries: Keys, Values, and More. The quiz contains 11 questions and there is no time limit. You'll get 1 point for each correct answer.
Python
#string-splitting
fromRealpython
2 months ago

The Python Documentary Celebrates History While Developer Surveys Celebrate Python - Real Python

At the end of August, Python: The Documentary premiered on YouTube, where you can watch it for free. It's an 84-minute film tracing Python's journey from Amsterdam side project to the world's most popular programming language: Produced by CultRepo (formerly Honeypot) and directed by Ida Bechtle, the documentary explores Python's evolution and the community that shaped it. It features Guido van Rossum and key contributors like Mariatta and recent Real Python Podcast guest, Travis Oliphant. The documentary also highlights the important role of PyLadies and addresses controversial topics including the Python 2 to 3 transition.
Software development
Python
fromPythonmorsels
2 months ago

The power of Python's print function

Python's print function accepts multiple positional arguments, can unpack iterables, handles automatic string conversion, and offers flexible separators—often replacing join for printing.
Python
fromPythonmorsels
2 months ago

The power of Python's print function

Python's print function accepts multiple arguments, unpacks iterables with *, and automatically converts objects to strings, providing flexible alternatives to join and f-strings.
Python
fromRealpython
2 months ago

uv vs pip: Managing Python Packages and Dependencies Quiz - Real Python

Choose between pip and uv by weighing install speed, dependency locking, project-level management, and suitability for specific environments and workflows.
fromdaniel.feldroy.com
2 months ago

TIL: Setting environment variables for pytest

When writing tests in pytest, often there's a need to set environment variables for your tests. Instead of modifying `os.environ` directly, which can lead to side effects and make tests harder to manage, here's how to do it with the [pytest-env](https://pypi.org/project/pytest-env/) package. First, install the package. ```sh pip install pytest-env # classic but works great uv add pytest-env # if you're one of us cool kids using uv uv add pytest-env --group test # if you use a specific test group of dependencies ```
Python
Python
fromPythonmorsels
2 months ago

Checking your operating system in Python

Use os.name, sys.platform, or platform.system() to detect the operating system in Python, varying in granularity and user-facing naming.
Software development
fromRealpython
2 months ago

Deep vs Shallow Copies in Python Quiz - Real Python

Practice deep and shallow copying in Python, including assignment semantics, object identity, nested and user-defined object copying, plus writing and customizing copy helpers.
Python
fromRealpython
2 months ago

Exploring Python Closures: Examples and Use Cases Quiz - Real Python

Test knowledge of Python closures with an 11-question, untimed quiz; earn one point per correct answer and receive a final percentage score.
fromRealpython
2 months ago

Profiling Performance in Python Quiz - Real Python

Ready to level up your Python code optimization skills? In this quiz, you'll revisit key concepts about profiling, benchmarking, and diagnosing performance bottlenecks. You'll practice with tools like cProfile and timeit, and see how deterministic and statistical profilers differ.
Python
Artificial intelligence
fromPythonshow
3 months ago

54 - Neural Networks and Data Visualization with Nicolas Rougier

Nicolas Rougier applies computational models, neural networks, and Python-based visualization tools like Glumpy and VisPy to study the brain and neurodegenerative diseases.
Python
fromRealpython
2 months ago

Python Skill Test Quiz - Real Python

A 12-question interactive quiz evaluates Python skills from fundamentals to advanced topics, scoring one point per correct answer and offering explanations and study links.
#docstrings
Python
fromZero To Mastery
2 months ago

[August 2025] Python Monthly Newsletter | Zero To Mastery

Curated Python highlights for August 2025 covering performance myths, alternatives to classes, nested functions, a pixel-art editor, pyx registry beta, and code formatter updates.
fromhttps://daniel.feldroy.com
2 months ago

TIL: Single source version package builds with uv (redux)

Here's how [he demonstrated](https://adamj.eu/tech/2025/07/30/python-check-package-version-importlib-metadata-version/) I should be doing it instead. ```toml # pyproject.toml [project] name = "air" version = "0.25.0" # This is the source of truth for the version number ```
Python
JavaScript
fromTreehouse Blog
2 months ago

Python vs. JavaScript Comparison for 2025

Knowledge of JavaScript makes learning Python easier because core programming concepts and data types are similar, with syntax and style differences to adjust to.
Python
fromTheregister
3 months ago

Python usage growing while Foundation struggles for funds

The eighth Python Developer Survey shows that Python usage is expanding with increasing numbers of new developers and significant challenges in version upgrades.
Python
fromRealpython
3 months ago

Deep vs Shallow Copies in Python - Real Python

Understanding how to copy objects in Python is essential for effective programming.
[ Load more ]