Created
December 22, 2025 02:19
-
-
Save mscalora/b9c23a5432128e0450298074efa01e5f to your computer and use it in GitHub Desktop.
Example of uv shebang with inline dependency metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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