Best of Planet Python โ€” October 2024

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

    SSH Scripting with Fabric and Python

    Learn how to use Fabric, a high-level Python package for executing shell commands remotely over SSH. This guide covers installation, establishing connections with credentials or SSH keys, running commands, and transferring files between a local and remote machine. Fabric simplifies tasks like uploading files to restricted directories by combining file transfer with sudo operations.

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

    Python Does What?!?: Enums make good singletons

    Using enums in Python can serve as effective singletons due to their single-value semantics. This approach allows type checkers like mypy to understand and validate that a variable has a specific value, avoiding issues related to instance allocation and ensuring correct behavior without custom methods.

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

    [October 2024] Python Monthly Newsletter ๐Ÿ’ป๐Ÿ

    The latest Python Monthly Newsletter covers key updates and resources in the Python world. This includes guidance on when to upgrade to Python 3.13, debugging tips using pdb and breakpoints, Django project ideas, and a dive into Python's Free-threaded feature from PEP-703. It also explores the latest happenings in the AI market, notable advancements like Meta Movie Gen, and a variety of tech news highlights from Apple, Google, and more.

  4. 4
    Article
    Avatar of planetpythonPlanet Pythonยท2y

    Django and the Python 3.13 REPL

    Discover how to integrate the new Python 3.13 REPL into your Django project despite the default shell showing the old Python REPL. Learn about a workaround solution using the `_pyrepl` package, while also understanding the stability trade-offs. The Django `shell` command can be customized to try different REPLs in sequence, including IPython, bpython, and the new Python 3.13 REPL, falling back to the old one if needed. For those using the default Python REPL, the new REPL presents a significant upgrade in usability and features.

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

    Switching from virtualenvwrapper to direnv, Starship, and uv

    The author switches from virtualenvwrapper to a combination of direnv, uv, and Starship for managing Python virtual environments. They detail their previous workflow and the new setup, along with solutions for customizing prompts, virtual environment directories, and reducing unnecessary shell messages. The new setup leverages direnv to automatically activate virtual environments, uv to quickly create them, and Starship to customize the shell prompt.