Best of Planet Python โ€” 2025

  1. 1
    Article
    Avatar of planetpythonPlanet Pythonยท1y

    Python Game Code: The Ultimate Pygame Guide

    This guide provides a step-by-step tutorial for creating a Python game called Neon Racer using Pygame. It covers setting up the game window, implementing player movement, adding a scrolling road background, generating obstacles, including pickups for extra points, and handling collision detection and scoring. Each module is integrated into a complete game with detailed code examples to ensure smooth and engaging gameplay.

  2. 2
    Article
    Avatar of planetpythonPlanet Pythonยท52w

    Top Python Code Quality Tools

    Improving Python code quality is crucial for developers seeking clean, efficient, and reliable code. This guide explores a variety of tools, including linters like Pylint and Flake8, type checkers like mypy, and formatters like Black, to enhance code readability and correctness. Security scanners such as Bandit and Safety ensure code safety, while tools like Coverage.py help maintain test coverage. Implementing these tools can enhance productivity and reduce errors in Python projects.

  3. 3
    Article
    Avatar of planetpythonPlanet Pythonยท49w

    Farewell to Michael Ryabushkin

    Michael Ryabushkin, known for his significant contributions to the Python community and his relentless support and kindness, passed away in May 2025. He was a dear friend who offered crucial support during challenging times. A memorial page has been created in his honor by the SoCal Python community.

  4. 4
    Article
    Avatar of planetpythonPlanet Pythonยท39w

    Python Roadmap with Free Courses/Certifcates to High-Paying Jobs

    Python leads to six-figure salaries when applied in specialized fields like AI, data science, cybersecurity, and automation. Five free certifications are recommended: Cisco's Programming Essentials for foundational skills, IBM Data Science Professional Certificate for data scientist roles, freeCodeCamp's Machine Learning with Python for ML engineering, Information Security certification for cybersecurity programming, and Jovian's Pandas course for data analysis mastery. Success requires specializing Python skills within high-demand domains rather than learning the language in isolation.

  5. 5
    Article
    Avatar of planetpythonPlanet Pythonยท1y

    Modern REST API Tutorial in Python

    Learn how to create reliable and maintainable production REST APIs in Python with this practical tutorial. The guide emphasizes building interfaces that are easy to use and ensuring long-term system maintainability.

  6. 6
    Article
    Avatar of planetpythonPlanet Pythonยท28w

    Spotlight on pdfly, the Swiss Army knife for PDF files

    pdfly is a Python-based CLI tool for PDF manipulation, offering features like metadata display, page extraction and merging, document compression, image extraction, text extraction, and PDF signing. The newly released version 0.5.0 adds digital signature verification, annotated page extraction, and page rotation capabilities. Built on fpdf2 and pypdf libraries, it provides a comprehensive solution for common PDF operations through simple command-line interfaces.

  7. 7
    Article
    Avatar of planetpythonPlanet Pythonยท1y

    Stop Writing `__init__` Methods

    The post describes the shift away from using custom `__init__` methods in Python classes, recommending the use of dataclasses, classmethod factories, and precise typing to enforce object validity and simplify construction. These practices improve code maintainability, flexibility, and future-proofing against new requirements. The author suggests that leveraging dataclasses handles attribute assignment, while classmethod factories and typing.NewType ensure valid, easy-to-use objects without resorting to custom `__init__` methods.

  8. 8
    Article
    Avatar of planetpythonPlanet Pythonยท25w

    Becoming a Core Developer

    A detailed account of contributing to numpydoc, from identifying the need for a pre-commit hook to building static code analysis functionality using Python's AST module. The journey involved creating the AstValidator class to analyze code without importing it, implementing configuration options via pyproject.toml, and adding inline comment support using the tokenize module. The author eventually joined numpydoc's core development team after demonstrating sustained, quality contributions that addressed real user pain points.

  9. 9
    Article
    Avatar of planetpythonPlanet Pythonยท1y

    Create your first app with Streamlit

    Learn the basics of Streamlit, an open-source Python library for building web apps for machine learning and data science. The guide covers installation, setting up a simple app, and adding interactive features like titles, headings, paragraphs, buttons, sliders, radio buttons, dropdown menus, and a sidebar. It concludes with creating a basic web app that filters the Iris dataset using sidebar controls.

  10. 10
    Article
    Avatar of planetpythonPlanet Pythonยท45w

    Will AI Replace Junior Developers? I Asked Experts at Pycon US

    A survey of Python community experts at PyCon US reveals mixed opinions on AI's impact on programming jobs. Most experts, including Guido van Rossum and other prominent Python developers, believe AI won't replace programmers but will change how they work. While some see AI as useful for boilerplate code and productivity enhancement, others emphasize the continued importance of understanding code fundamentals. The consensus suggests AI will augment rather than replace developers, with junior developers needing to focus on learning and adaptation to remain competitive.

  11. 11
    Article
    Avatar of planetpythonPlanet Pythonยท52w

    From Backend to Frontend: Connecting FastAPI and Streamlit

    The post explains how to create a frontend using Streamlit for a FastAPI backend, providing an efficient, Python-based UI. It discusses the benefits of using Streamlit, offers guidance on making API calls, and covers setting up environment variables and CORS. The author also describes the deployment process using Streamlit Cloud and highlights the advantages of using Docker for development and deployment.

  12. 12
    Article
    Avatar of planetpythonPlanet Pythonยท33w

    uv cheatsheet

    A comprehensive command reference for uv, the fast Python package manager and project management tool. Covers essential commands for creating projects, managing dependencies, building and publishing packages, working with scripts, managing Python versions, and using tools in isolated environments. Includes practical examples for common workflows like adding/removing dependencies, version bumping, and running scripts with specific Python versions.

  13. 13
    Article
    Avatar of planetpythonPlanet Pythonยท41w

    Another Python TUI Package

    Asciimatics is a Python library for creating text-based user interfaces (TUIs) with a retro aesthetic. The tutorial covers installation via pip, creating a colorful Hello World application that displays random text across the terminal, and building forms with widgets like text inputs and buttons using layouts and frames. While not as modern as Textual, Asciimatics offers a charming old-school approach to terminal application development with its Screen, Scene, and Effects hierarchy.

  14. 14
    Article
    Avatar of planetpythonPlanet Pythonยท50w

    What does @Slot() do?

    The post explores the usage and functionality of the @Slot decorator in PySide6, a tool for marking Python methods as Qt slots. While the decorator isn't always necessary, it offers advantages such as reducing memory usage and slightly improving performance. It becomes essential when working with threads to avoid segmentation faults. The performance benefits are minor, but decorating slots can be beneficial in applications with numerous signal-slot connections.

  15. 15
    Article
    Avatar of planetpythonPlanet Pythonยท1y

    10 Viral Tips to Learn Python Instantly ๐Ÿš€

    Python remains one of the most sought-after programming languages, useful in AI, web development, and automation. Learn Python quickly with these strategies: engage in interactive courses, build mini-projects, utilize AI tools for debugging, follow structured roadmaps, gamify your learning, join Python communities, read open-source code, automate real-world tasks, take on one-day coding challenges, and stay updated with Python blogs.

  16. 16
    Article
    Avatar of planetpythonPlanet Pythonยท21w

    Getting Started With the NiceGUI Library in Python

    NiceGUI is a Python library for building interactive web-based graphical user interfaces without requiring HTML, CSS, or JavaScript knowledge. The guide covers installation via pip, creating a basic "Hello, World!" application, and exploring various UI elements including text, controls, data visualization, and audiovisual components. It demonstrates layout techniques using cards, rows, columns, and grids, and explains event handling through on_click, on_change callbacks and the on() method. The tutorial provides practical examples like a temperature data table with Matplotlib plots and a user profile form, making it accessible for Python developers new to web GUI development.

  17. 17
    Article
    Avatar of planetpythonPlanet Pythonยท28w

    Releasing Python 3.14.0

    A detailed chronicle of the Python 3.14.0 release process, documenting the week leading up to release day. The post walks through pre-release checks, handling last-minute bugs (including a Linux kernel issue), running automated release scripts, coordinating multi-platform builds (Windows, macOS, Android), and final publishing steps. It provides insight into the technical workflow of releasing a major Python version, including buildbot monitoring, CI automation, profile-guided optimization builds, and the various announcement channels used to communicate the release.

  18. 18
    Article
    Avatar of planetpythonPlanet Pythonยท1y

    Create Project-Less Python Utilities with uv and Inline Script Metadata

    Learn how to create and run Python utility scripts with inline metadata using uv. This method avoids the need for a full Python project and simplifies dependency management by embedding metadata directly into the script. The post provides an example script for searching and fetching details from the Google Books API, along with additional examples for summarizing YouTube videos and scraping articles.

  19. 19
    Article
    Avatar of planetpythonPlanet Pythonยท33w

    Python Memory Tricks to Boost Performance

    Comprehensive guide covering practical Python memory optimization techniques including generators for lazy loading, __slots__ for reducing object overhead, weak references for cache management, string interning, smart data structure choices, chunked file processing, and leveraging Python 3.13's mimalloc. Includes ready-to-use code examples and memory profiling tools to help developers reduce RAM usage by 40-60% in large applications.

  20. 20
    Article
    Avatar of planetpythonPlanet Pythonยท1y

    The Absolute Minimum Every Python Web Application Developer Must Know About Security

    When developing Python web applications, it's essential to follow basic security principles: never store passwords in plain text, always use salted hashes or delegate password management to modern frameworks, and ensure data is encrypted both in transit and at rest. The Defence in Depth approach emphasizes multiple layers of security, including the use of TLS for network security and understanding cryptography algorithms. The guide also covers important security principles, the OWASP Top Ten vulnerabilities, and the CVE warning system.

  21. 21
    Article
    Avatar of planetpythonPlanet Pythonยท45w

    A Python dict that can report which keys you did not use

    A custom Python dictionary class that tracks which keys have been accessed, helping developers identify unused data fields in their applications. The TrackingDict class extends the built-in dict and maintains a set of accessed keys, providing properties to check both accessed and never-accessed keys. This is particularly useful for optimizing database queries, ensuring complete test coverage, and identifying redundant data retrieval in applications.

  22. 22
    Article
    Avatar of planetpythonPlanet Pythonยท1y

    Matplotlib Practice Online: Free Exercises

    Explore a comprehensive set of Matplotlib exercises and practice using an online Matplotlib compiler. Learn how to analyze trends, build machine learning models, and explore datasets with various plot types such as bar charts, scatter plots, histograms, and more. The exercises include practical examples to help you understand and visualize data using Python, making it easier for you to focus on mastering data visualization.

  23. 23
    Article
    Avatar of planetpythonPlanet Pythonยท1y

    Decorators | Pydon't ๐Ÿ

    Learn about the decorator pattern in Python, why it exists, how to use it, and when to use it. This post explains how the decorator pattern helps write more modular and efficient code, with practical examples like caching and timing functions. It also covers creating custom decorators, using functools.wraps to preserve function metadata, and decorators with arguments. Additionally, it touches on class decorators and their use cases.

  24. 24
    Article
    Avatar of planetpythonPlanet Pythonยท40w

    Don't call dunder methods

    Dunder methods (double-underscore methods like __str__, __len__) should be implemented in your Python classes but not called directly. Instead of calling obj.__str__(), use str(obj). Python's built-in functions and operators provide the proper high-level interface to these low-level implementation details. Direct dunder method calls can fail in cases where the high-level operations would succeed, such as with type coercion between integers and floats.

  25. 25
    Article
    Avatar of planetpythonPlanet Pythonยท1y

    How I run standalone Python in 2025

    The author shares their experience of managing Python projects in 2025. They use uv for Python version and dependency management, replacing tools like pip, pyenv, Homebrew, and Poetry. The author explains how they handle Python executables for standalone scripts using a custom bash script that integrates uv to quickly run scripts with specific dependencies.