Skip to content

Instantly share code, notes, and snippets.

@jjorissen52
Last active January 15, 2023 21:38
Show Gist options
  • Save jjorissen52/f5ce09296496c158a0004bda38fb8409 to your computer and use it in GitHub Desktop.
Save jjorissen52/f5ce09296496c158a0004bda38fb8409 to your computer and use it in GitHub Desktop.
Example of a python script which can specify its own dependencies, including python itself
#! /usr/bin/env nix-shell
#! nix-shell -i python3 -p python3 -p python3Packages.requests -p python3Packages.fire
import requests
import fire
class CLI:
def get(self, url):
return requests.get(url).status_code
fire.Fire(CLI)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment