Get the latest tech news

Self-contained Python scripts with uv


TLDR You can add uv into the shebang line for a Python script to make it a self-contained executable. I am working on a Go project to better learn the language.

When I need to test out an endpoint, I prefer to use the httpx python package inside an ipython REPL over making curl requests. I don't have to manage the virtual environment myself nor worry about cluttering my system python with packages that I will invariably forget to remove later. What's even better is that I can run this script on any (Unix) system that has uv installed without needing to do ANY dependency or virtual environment management.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of self

self

Related news:

News photo

Self-Supervised Learning from Images with JEPA (2023)

News photo

Using uv and PEP 723 for Self-Contained Python Scripts

News photo

"Self-densified" wood could give metal a run for its money thanks to a new self-densifying technique for creating super-strong wood.