Page 2 of 3

Re: Editor for Python on Mac

PostPosted: Sun Sep 22, 2019 1:45 pm
by mgolden50
That would be great!

The key thing I'm looking for is how make indigo calls from a script in Bbedit. I tried what I thought should work but it didn't.

I entered the suggested command line in terminal but it was from the primary shell assigned to my Terminal app. Should it be something else?

Thanks,

Mike

Re: Editor for Python on Mac

PostPosted: Sun Sep 22, 2019 3:32 pm
by jay (support)
You can't run Indigo Python scripts in a normal Python interpreter. For the moment, though, you can write your script in BBEdit, then copy/paste it into the interpreter window you get when you select the Plugins->Open Scripting Shell menu item.

After we ship 7.4, I'll investigate to see if there's any more direct way to run scripts from BBEdit (well, I know there is, but I want to check out the various alternatives).

Re: Editor for Python on Mac

PostPosted: Sun Sep 22, 2019 3:35 pm
by mgolden50
Thanks,

Mike

Re: Editor for Python on Mac

PostPosted: Sun Sep 22, 2019 3:48 pm
by FlyingDiver
jay (support) wrote:
After we ship 7.4, I'll investigate to see if there's any more direct way to run scripts from BBEdit (well, I know there is, but I want to check out the various alternatives).


That would be great!

Re: Editor for Python on Mac

PostPosted: Sun Sep 22, 2019 7:47 pm
by citysnaps
On the subject of Python program development, does anyone have recommendations for books, online courses, guides, etc for getting up to speed on Python? I've written software for a handful of languages over the years, but am looking for information and tools to help with the learning curve.

Thanks!

Re: Editor for Python on Mac

PostPosted: Mon Sep 23, 2019 3:40 am
by DaveL17
citysnaps wrote:
On the subject of Python program development, does anyone have recommendations for books, online courses, guides, etc for getting up to speed on Python? I've written software for a handful of languages over the years, but am looking for information and tools to help with the learning curve.

Thanks!

When I first started using Indigo, I didn't know any Python at all. I watched YouTube videos from MIT Open Courseware and Google. Microsoft has just added a course but that may be too rudimentary for you, and there's always Kahn Academy. Since you have experience, I would recommend the MIT course which will scoot through the basics pretty quickly.

I also got answers to a lot of my questions on these forums and on Stack Overflow. I didn't find the original Python docs to be that helpful at first..

Re: Editor for Python on Mac

PostPosted: Mon Sep 23, 2019 8:08 am
by mgolden50
Jay,

I opened the scripting shell from the plugins menu and I get this:

Last login: Fri Sep 20 14:21:22 on ttys000
login: login: Could not determine audit condition
login: login: Could not determine audit condition

[Process completed]

The Terminal window won't accept any input.

Thanks,

Mike

Re: Editor for Python on Mac

PostPosted: Mon Sep 23, 2019 8:27 am
by racarter
citysnaps wrote:
On the subject of Python program development, does anyone have recommendations for books, online courses, guides, etc for getting up to speed on Python? I've written software for a handful of languages over the years, but am looking for information and tools to help with the learning curve.

Thanks!



I found this book to be helpful:

https://www.oreilly.com/library/view/py ... 133354461/

Re: Editor for Python on Mac

PostPosted: Mon Sep 23, 2019 9:23 am
by mgolden50
Jay,

Now after opening shell I can't get the Terminal app to open with its normal login prompt.

Re: Editor for Python on Mac

PostPosted: Mon Sep 23, 2019 9:24 am
by FlyingDiver
mgolden50 wrote:
Jay,

Now after opening shell I can't get the Terminal app to open with its normal login prompt.


Reboot your computer. Also, check these posts:

https://stackoverflow.com/questions/424 ... -condition

https://www.reddit.com/r/osx/comments/a ... condition/

Re: Editor for Python on Mac

PostPosted: Mon Sep 23, 2019 9:29 am
by mgolden50
Thanks Joe. Duh

Mike

Re: Editor for Python on Mac

PostPosted: Tue May 31, 2022 8:00 am
by Turribeach
What is the latest on this? Are we still unable to run Python scripts outside Indigo? I am using Visual Studio Code now which for the most part works fine although all the references to indigo.* are highlighted as missing. Anything I can do to improve that? Thanks

Re: Editor for Python on Mac

PostPosted: Tue May 31, 2022 8:05 am
by FlyingDiver
Turribeach wrote:
What is the latest on this? Are we still unable to run Python scripts outside Indigo? I am using Visual Studio Code now which for the most part works fine although all the references to indigo.* are highlighted as missing. Anything I can do to improve that? Thanks


Python scripts run fine outside Indigo. But you can't run a script that references Indigo (has "import indigo") outside Indigo. References to indigo require that the script be running in an IndigoPluginHost wrapper, as that's the only way for the script to communicate with the Indigo server.

What you can do is set up an action group that references an external Python group, edit that in whatever editor you want, and use the action group to run the script.

Re: Editor for Python on Mac

PostPosted: Tue May 31, 2022 9:11 am
by jay (support)
Turribeach wrote:
I am using Visual Studio Code now which for the most part works fine although all the references to indigo.* are highlighted as missing. Anything I can do to improve that


If you just want to shut up the red warnings, putting this at the top may limit that to just one highlight:

Code: Select all
try:
    import indigo
except:
    pass


Note this has nothing to do with running scripts that reference indigo from VS Code (it can't be done as described above), it only shuts up the annoying highlighting.

Re: Editor for Python on Mac

PostPosted: Tue May 31, 2022 9:16 am
by Turribeach
Thanks Joe, that's what I have been doing for now but I was wondering if anything has changed due to the move to Python 3.

And Thanks Jay, I like that little hack, one highlight my OCD can deal with. :mrgreen: