pywrap.sh 340 B

123456789101112131415
  1. #!/usr/bin/env bash
  2. case "${0##*/}" in
  3. pywrap.sh) arg1="";;
  4. *) arg1="$0.py" ;;
  5. esac
  6. for bin in python python2 python2.7 python2.6 python2.5 python2.4; do
  7. case "$($bin -V 2>&1)" in
  8. "Python 2"*) exec $bin $arg1 "$@" ;;
  9. esac
  10. done
  11. echo "Unable to find a Python 2.x interpreter for executing ${arg1:+$arg1 }$@ !" >&2
  12. exit 1