forked from wakass/neqstlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtlab
executable file
·31 lines (29 loc) · 996 Bytes
/
qtlab
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
26
27
28
29
30
31
#!/bin/bash
basedir=`dirname $0`
if type -p ipython2; then
_ipython=ipython2
isexplicitpython2=true
echo "Found iPython2 executable"
elif type -p ipython; then
_ipython=ipython
isexplicitpython2=false
echo "Found iPython executable, hopefully using Python2"
else
echo "no ipython executable found in PATH"
fi
if [[ "$_ipython" ]]; then
version=$("$_ipython" --version 2>/dev/null)
# Old ipython versions have -Version argument in stead of --version.
# Determine from the length of the return string if the help-text
# is returned instead of the version number.
if [[ ${#version} > 10 ]]; then
version=$("$_ipython" -Version)
fi
if [ "$isexplicitpython2" = true ]; then
ipython2 --gui=gtk -i $basedir/source/qtlab_shell.py -- "$@"
elif [[ "$version" < "0.11" ]]; then
ipython -gthread $basedir/source/qtlab_shell.py -- "$@"
else
ipython --gui=gtk -i $basedir/source/qtlab_shell.py -- "$@"
fi
fi