Skip to content

Instantly share code, notes, and snippets.

@mscalora
Created December 22, 2025 02:19
Show Gist options
  • Select an option

  • Save mscalora/b9c23a5432128e0450298074efa01e5f to your computer and use it in GitHub Desktop.

Select an option

Save mscalora/b9c23a5432128e0450298074efa01e5f to your computer and use it in GitHub Desktop.
Example of uv shebang with inline dependency metadata
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "requests",
# ]
# ///
import requests
try:
response = requests.get("https://ipecho.io/plain", timeout=5)
response.raise_for_status()
print(f"Apparent Local IP: {response.text}")
except Exception as e:
print(f"Error retrieving IP: {e}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment