Skip to content

Instantly share code, notes, and snippets.

@jcsalterego
Forked from defunkt/gist:172292
Created August 21, 2009 18:43
Show Gist options
  • Save jcsalterego/172308 to your computer and use it in GitHub Desktop.
Save jcsalterego/172308 to your computer and use it in GitHub Desktop.
# put this in ~/.bash_profile or whatever
python_or_python () {
if [ "$1" == "" ]; then
python
else
python "$@"
fi
}
alias python="python_or_python"
# now `python` on its own launches python
$ python -c "print 'hi'"
hi
$ python
Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 'woot'
'woot'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment