Last active
October 8, 2015 22:37
-
-
Save glsignal/3398796 to your computer and use it in GitHub Desktop.
Start a Python http server in the present directory
This file contains hidden or 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
| python=$(which python) | |
| if [ -n "$python" ]; then | |
| python_major=$(python -V 2>&1 | cut -d " " -f 2 | cut -d "." -f 1) | |
| if [ $python_major -lt 3 ]; then | |
| alias webme='python -m SimpleHTTPServer' | |
| else | |
| alias webme='python -m http.server' | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment