Skip to content

Instantly share code, notes, and snippets.



Last active Dec 17, 2019
What would you like to do?
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.
alias gp='function __gp() { (python3 ~/Documents/python/$ $(shift;printf "$*") 2>/dev/null) || echo "File not found or errors occurred."; unset -f __gp; }; __gp'
# (assumption 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