Last active
January 15, 2023 21:38
-
-
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
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 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