Editor for Python on Mac

Posted on
Sun Sep 22, 2019 1:45 pm
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: Editor for Python on Mac

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

Posted on
Sun Sep 22, 2019 3:32 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Editor for Python on Mac

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).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Sep 22, 2019 3:35 pm
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: Editor for Python on Mac

Thanks,

Mike

Posted on
Sun Sep 22, 2019 3:48 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Editor for Python on Mac

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!

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Sep 22, 2019 7:47 pm
citysnaps offline
Posts: 44
Joined: Jul 13, 2016

Re: Editor for Python on Mac

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!

...........................
Brad
Urban photoblog: www.citysnaps.net

Posted on
Mon Sep 23, 2019 3:40 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Editor for Python on Mac

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..

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Sep 23, 2019 8:08 am
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: Editor for Python on Mac

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

Posted on
Mon Sep 23, 2019 8:27 am
racarter offline
User avatar
Posts: 468
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: Editor for Python on Mac

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/

Posted on
Mon Sep 23, 2019 9:23 am
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: Editor for Python on Mac

Jay,

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

Posted on
Mon Sep 23, 2019 9:24 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Editor for Python on Mac

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/
Last edited by FlyingDiver on Mon Sep 23, 2019 9:32 am, edited 1 time in total.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Sep 23, 2019 9:29 am
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: Editor for Python on Mac

Thanks Joe. Duh

Mike

Posted on
Tue May 31, 2022 8:00 am
Turribeach offline
Posts: 429
Joined: Feb 06, 2015
Location: London, UK

Re: Editor for Python on Mac

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

Posted on
Tue May 31, 2022 8:05 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Editor for Python on Mac

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.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue May 31, 2022 9:11 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Editor for Python on Mac

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.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue May 31, 2022 9:16 am
Turribeach offline
Posts: 429
Joined: Feb 06, 2015
Location: London, UK

Re: Editor for Python on Mac

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:

Who is online

Users browsing this forum: No registered users and 2 guests