[ANSWERED]: Python script file slower than from built-in

Posted on
Mon Jul 21, 2014 10:39 am
tornado offline
User avatar
Posts: 104
Joined: Jun 30, 2014

[ANSWERED]: Python script file slower than from built-in

Hi,

I'm a new Indigo user and am loving it, however I noticed this past weekend that when I try to run a script via an action from a file (.py) in my OS instead of embedding the script in indigo, that the execution doesn't happen as quickly.

The way I discovered it is that when my lights turn on via my Lutron device, the serial interface spits out a rapid series of notifications - half or so of these are missed or ignored by the interpreter, when running from the .py file. When I move the same exact code into the Indigo app they are acted upon.

Any suggestion or am I relegated to using the built in editor from now on?

Thanks.

Posted on
Mon Jul 21, 2014 1:51 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Python script execution from file slower than from built

External script files are always run in a new process, which can take some time to initialize and get started.

Embedded scripts run in a shared process that only has to be started the first time it is called.

If the script is too long (or takes too long to execute safely) as an embedded script, then I would suggest creating a plugin instead. Like an embedded script plugins are started only once and can react very quickly to triggers/requests.

Image

Posted on
Mon Jul 21, 2014 4:13 pm
tornado offline
User avatar
Posts: 104
Joined: Jun 30, 2014

Re: [ANSWERED]: Python script file slower than from built-in

Thanks :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests

cron