#! /bin/sh if [ -z "$1" ]; then echo "Usage: compyle [-1] file.py..." exit 1 fi TEMPLATE="from py_compile import compile; compile('" for file in "$@"; do pgm=$TEMPLATE$file"')" python"$PY_VER" -c "$pgm" || exit 1 python"$PY_VER" -OOc "$pgm" || exit 1 done #pgm="$HOME/lib/python/com.py" #python"$PY_VER" $pgm "$@" && python"$PY_VER" -O $pgm "$@"