Skip to content

Instantly share code, notes, and snippets.

@aal89

aal89/.bash_profile

Last active Dec 17, 2019
Embed
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/$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