TIL you can embed dependencies in a gist and then run it as a one-shot script using uv. In screenshot 1 I've pulled in pyfiglet to create a snazzy message. You can inline your dependencies into your script using `uv add --script <dep>`. This adds the necessary preamble as a comment (screenshot 2). I came across this tip whilst surfing Simon Willison’s gists. I've linked to Simon's more detailed blog post and the documentation in . simonwillison.net/2024/Dec/19/
docs.astral.sh/uv/guides/scrip

powershell prompt where I'm running a python script in gist. The script installs it dependency (pyfiglet) and prints a banner that reads, "no sploit today"This is the source code to the script run in the previous screenshot. It shows the python dependencies as a preamble comment at the start of the script. Then the script it self imports pyfliglet, initialises the object to use the slant font and then renders the banner by printing the return value from the renderText method. You can see the full text here https://gist.github.com/booyaa/208a265f0f0ecc1ec21008145689ab62#file-how-long-before-pwn-py
0

If you have a fediverse account, you can quote this note from your own instance. Search https://hachyderm.io/users/booyaa/statuses/114958269924150234 on your instance and quote it. (Note that quoting is not supported in Mastodon.)