File: python_launcher

package info (click to toggle)
handbrake 1.6.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 26,924 kB
  • sloc: ansic: 111,120; sh: 3,024; python: 2,354; ruby: 1,635; makefile: 588; xml: 186; sed: 16; csh: 15
file content (25 lines) | stat: -rwxr-xr-x 346 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/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