#!/bin/sh
#

inpath()
{
    IFS=:
    for d in $PATH
    do
        if [ -x $d/$1 ]; then
            return 0
        fi
    done
    return 1
}

for p in python3 python2 python python3.7 python3.6 python2.7
do
    if ( inpath $p ); then
        exec $p "$@"
        exit 0
    fi
done

echo "ERROR: no suitable version of python found."
exit 1
