|
|
|
|
|
by fleekonpoint
1250 days ago
|
|
I use a separate directory and venv for each script. To execute the script, I use a shell script to call the venv's python interpreter. This is also how I use python scripts with cron/systemd. #!/bin/bash
# myscript.sh
venv/bin/python3 myscript.py
You could also skip the shell script and use aliases in your .bashrc. |
|
I'm sure I could come up with solutions that are very robust for my particular machine, but I would like something that allows me to share it as a gist and a teammate could just as easily use it, or I can use it myself on another machine without hassle. In other words, a solution contained within the script iteself and maybe one or two binaries outside that make it possible.