Last active
December 17, 2019 16:34
-
-
Save aal89/58e254efeb0fca76db6daa521fec40f9 to your computer and use it in GitHub Desktop.
Profile alias to quickly execute Python scripts from anywhere on some random path with regard to sys.argv, for *nix systems. Alias gp stands for globalpython.
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
alias gp='function __gp() { (python3 ~/Documents/python/$1.py $(shift;printf "$*") 2>/dev/null) || echo "File not found or errors occurred."; unset -f __gp; }; __gp' | |
# (assumption hiworld.py is an actual file) | |
# | |
# usage: gp hiworld | |
# usage: gp sub/dir/hiworld arg0 arg1 | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment