Skip to content

Instantly share code, notes, and snippets.

@cgoldberg
Created August 3, 2025 14:45
Show Gist options
  • Save cgoldberg/f6adf8117a27ddbacb0caba631a62e6f to your computer and use it in GitHub Desktop.
Save cgoldberg/f6adf8117a27ddbacb0caba631a62e6f to your computer and use it in GitHub Desktop.
Python - example script using pipx with dependencies defined using inline script metadata (PEP 723)
#!/usr/bin/env -S pipx run
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "selenium==4.34.2",
# ]
# ///
# This script has dependencies defined using inline script metadata (PEP 723)
# Running it will create a temporary virtual environment, install depenendencies, then run the code (requires pipx)
# Note: you can do similar with: `#!/usr/bin/env -S uv run --script`
from selenium import webdriver
driver = webdriver.Chrome()\
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment