Kodi Community Forum
How to run a python script instantly without delay? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: How to run a python script instantly without delay? (/showthread.php?tid=342225)



How to run a python script instantly without delay? - noolinrut - 2019-03-19

Hi!

How to run a python script instantly without delay?

Posted in the desired window loading script:
xml:

<?xml version="1.0" encoding="UTF-8"?>
<window id="1110">
    <onload>RunScript(special://home/script.py)</onload>
...
When the window is opened, the script is executed, but always with a delay of 1-2 seconds.

How to get rid of the delay? Is there any way to preload it?

The most interesting thing is that if you call window 2 from a script in window 1, the script immediately starts:
xml:

...
<onclick>RunScript(special://home/script.py)</onclick>
...



RE: How to run a python script instantly without delay? - cartman.dos - 2019-03-19

I've always had a lag with custom scripts. It improved a lot with transitioning into a stand-alone addon.


RE: How to run a python script instantly without delay? - noolinrut - 2019-03-19

And there are examples? Or any other solution?


RE: How to run a python script instantly without delay? - cartman.dos - 2019-03-19

(2019-03-19, 22:28)noolinrut Wrote: And there are examples? Or any other solution?
 No idea.
Your suggestion of using script to invoke the window and then from the script a while loop to detect window loaded and start the rest of script sounds an interesting hack but probably bad practice...