My python script not running via autostart.sh

If you use ()& then this block is run in background and kodi can start immediately. If not kodi will start only when script ends.