#!/bin/sh
#!/bin/sh
# -*- mode: Python -*-

""":"
# bash code here; finds a suitable python interpreter and execs this file.
# prefer "python3", but try "python2" if the user doesn't have "python3".
for pyver in 3 2; do
    which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@"
done
echo "Could not find a suitable Python version. Please ensure either python3 or python2 are installed. See https://github.com/hatfullr/pysplash for details on dependencies." >&2
exit 1
":"""



from signal import signal,SIGINT
from lib.window import Window
from gui.gui import GUI
import globals

try:
    from numba import cuda
    has_jit = True
except ImportError:
    has_jit = False


    
if __name__ == '__main__':
   if has_jit: cuda.select_device(0)
   globals.init()
   
   win = Window()
   gui = GUI(win)
   win.protocol("WM_DELETE_WINDOW",win.close)
   signal(SIGINT,win.close)
   win.launch()

