4 ms·
You just use the dependencies, for example: $ cat /tmp/hello.py #! /opt/appfs/rkeene.org/python3/platform/latest/bin/python3 print("Hello, world!".rjust
by rkeene2 4y ago
You just use the dependencies, for example:
$ cat /tmp/hello.py
#! /opt/appfs/rkeene.org/python3/platform/latest/bin/python3
print("Hello, world!".rjust(20, "-"))
$ /tmp/hello.py
-------Hello, world!
- DangitBobby 4y agoThe really nice thing about the nix-shell example is I can specify external python dependencies within the script itself, and even the python version itself, all within one file, and nix-shell just takes care of it.
- rkeene2 4y agoIf you change `latest` to the version [0], then you'll get that exact version. Additionally any external dependencies can be specified by just accessing them the same way you would in `nix-shell`, just using the path instead of installing. For example, if you wanted to use the "awscli" (the only Python package I already created within AppFS) you would do: $ cat /tmp/aws.py #! /opt/appfs/rkeene.org/python3/platform/latest/bin/python3 import sys sys.path.append('/opt/appfs/rkeene.org/aws-cli/platform/latest/lib/python3.6/site-packages') import awscli print(awscli) $ /tmp/aws.py <module 'awscli' from '/opt/appfs/rkeene.org/aws-cli/platform/latest/lib/python3.6/site-packages/awscli/__init__.py'> [0] https://browser.appfs.net/rkeene.org/python3/linux-x86_64/3.6.4/bin https://browser.appfs.net/rkeene.org/python3/linux-x86_64/3....