Created
January 19, 2012 13:27
-
-
Save hirochachacha/1640047 to your computer and use it in GitHub Desktop.
pycco on the fly
This file contains 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
#!/bin/bash -- | |
set -e | |
TEMP_DIR="/tmp/pycco-$$" | |
PYTHON_DIR=$(python -c "import $1; import os; print(os.path.dirname($1.__file__))") | |
trap "rm -rf $TEMP_DIR" EXIT | |
mkdir $TEMP_DIR | |
find $PYTHON_DIR -name '*.py' -type f | xargs pycco -d $TEMP_DIR | |
sleep 1 && python -c "import webbrowser; webbrowser.open('http://localhost:8000/')" & | |
cd $TEMP_DIR && python -m SimpleHTTPServer 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment