Kodi Community Forum

Full Version: How to run a python script instantly without delay?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

How to run a python script instantly without delay?

Posted in the desired window loading script:

<?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:

...
<onclick>RunScript(special://home/script.py)</onclick>
...
I've always had a lag with custom scripts. It improved a lot with transitioning into a stand-alone addon.
And there are examples? Or any other solution?
(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...