Lost - Call Python Script from Embedded Server Action

Posted on
Wed Oct 26, 2016 9:59 am
HFTobeason offline
Posts: 272
Joined: Nov 07, 2003

Lost - Call Python Script from Embedded Server Action

I have a Python script on my Desktop, myScript.py.

I would like to call it from within an Embedded Server Action, and pass three variables.

Despite several hours of searching, I can't even figure out how to call the script. Every method I try fails with "Invalid Syntax".

For simplicity's sake, assume the script is:

Code: Select all
indigo.server.log("Started", type="HVAC System ==================>")
And assume that script is at:

MacintoshHD/Users/User1/Desktop/myScript.py

I am totally stumped. And, obviously, an idiot.

TIA for any help.

Posted on
Wed Oct 26, 2016 10:36 am
jay (support) offline
Site Admin
User avatar
Posts: 15146
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Lost - Call Python Script from Embedded Server Action

If I might suggest - check out the Shared Classes and Methods in Python Files (Python Attachments or Modules) section in the scripting tutorial - I think it'll answer your question (perhaps). It does require moving your script, so if that's a problem then it's going to get a lot more complicated... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Oct 26, 2016 11:09 am
HFTobeason offline
Posts: 272
Joined: Nov 07, 2003

Re: Lost - Call Python Script from Embedded Server Action

Thank you for your reply. Yeah, I read that page about 10 times. Guess I'll have to read it again...

Which of the two Python folders should I be using, 2.6 or 2.7?

And is it possible to use an alias so that the script would get backed up in my normal User folder backup?

As for passing parameters? What might I read to learn how to do that?

Posted on
Wed Oct 26, 2016 1:14 pm
HFTobeason offline
Posts: 272
Joined: Nov 07, 2003

Re: Lost - Call Python Script from Embedded Server Action

Looks like only 2.6 works.

And I've figured out how to send parameters.

Thanks.

Posted on
Wed Oct 26, 2016 5:16 pm
jay (support) offline
Site Admin
User avatar
Posts: 15146
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Lost - Call Python Script from Embedded Server Action

I think a unix symlink would probably work.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Nov 23, 2016 1:20 pm
HFTobeason offline
Posts: 272
Joined: Nov 07, 2003

Re: Lost - Call Python Script from Embedded Server Action

You guys should probably update the Shared Classes and Methods in Python Files (Python Attachments or Modules) section to account for Python 2.7 in Indigo 7.

Posted on
Wed Nov 23, 2016 2:04 pm
matt (support) offline
Site Admin
User avatar
Posts: 18911
Joined: Jan 27, 2003
Location: Texas

Re: Lost - Call Python Script from Embedded Server Action

Thanks for catching this. I believe I have all references to older versions of python corrected now.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests