Last active
July 13, 2018 08:14
-
-
Save jimmybot/776f8a1eb2f46a0421e9d87a20c13ec2 to your computer and use it in GitHub Desktop.
Running Python scripts using the Python interpreter dynamically from the local virtual env rather than hardcoding a full path
This file contains 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
#!/bin/sh | |
"exec" "`dirname $0`/python" "$0" "$@" | |
"exit $?" | |
print('hello from my double entendre script!') | |
print('a python script that runs as both sh that then runs the same script as sh') | |
raise Exception("things didn't go well: check my exit code is 1") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment