]> git.phdru.name Git - dotfiles.git/blob - bin/compyle
Initial import
[dotfiles.git] / bin / compyle
1 #! /bin/sh
2
3 if [ -z "$1" ]; then
4    echo "Usage: compyle [-1] file.py..."
5    exit 1
6 fi
7
8 TEMPLATE="from py_compile import compile; compile('"
9
10 for file in "$@"; do
11    pgm=$TEMPLATE$file"')"
12    python"$PY_VER" -c   "$pgm" || exit 1
13    python"$PY_VER" -OOc "$pgm" || exit 1
14 done
15
16 #pgm="$HOME/lib/python/com.py"
17 #python"$PY_VER" $pgm "$@" && python"$PY_VER" -O $pgm "$@"