Skip to content

Instantly share code, notes, and snippets.

@glsignal
Last active October 8, 2015 22:37
Show Gist options
  • Select an option

  • Save glsignal/3398796 to your computer and use it in GitHub Desktop.

Select an option

Save glsignal/3398796 to your computer and use it in GitHub Desktop.
Start a Python http server in the present directory
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