What Python IDEs & practices are you using?

Posted on
Mon Dec 31, 2012 8:18 am
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

What Python IDEs & practices are you using?

I've been trying to get a good 'flow' going with respect to developing plugins and for some reason everything just feels cumbersome... It's not Python, it's been my scripting language of choice for years in the Linux world - although I admit that 80% of what I would write would be written in VIM and be command line and systems oriented, very little 'GUI' stuff...

I'm having trouble finding a GUI that I'm comfortable with and also finding a system that feels smooth. My environment is Mac Mini running headless in a different part of the house. I open a shared folder on the mini, a screen sharing session to see the desktop should I need it, run the Indigo console on my workstation (13" MB Air most of the time) connected to the mini, and then a Python coding environment of some sort. I find myself constantly switching between them all while coding/deploying/testing/reverting/etc. I've tried running a trial version of Indigo on my workstation and that helps a little with switching around, but I have no devices on the trial copy so that approach has very limited value. I'm wondering if anyone else has run into anything similar and if so how did you overcome it?

As to an IDE - I've tried several but the ones that felt intuitive had lacking Python support. The ones with good Python support felt kludgy (at least to me). I should start by saying that I hate Eclipse. We use it at work for Java development and I simply can't stand it. I've tried several variants of it - Aptanna, Spring, Tibco, etc. and they're all basically the same to me - when using Eclipse I feel like I'm trying to herd cats. Eclipse has great support for Python (using PyDev) but I just don't mesh with it like I feel I should. I have Active State's Komodo IDE (the paid-for version) which is what I use most often , for me it's better than Eclipse, but I still don't know if it's ideal. I like Panic's Coda for other stuff, but it doesn't work well for Python. Likewise other text editors with syntax highlighting like BBEdit, Text Wrangler, Textmate are good at what they do, but they're missing code completion, run-time debugging and other features that true IDEs have. It would be sweet if XCode had proper Python support, but alas nothing after all these years... Sadly the tool that feels best is Microsoft's Visual Studio (iron Python), but I no longer have Windows machines in the house plus I would imagine it would be a true nightmare to develop an Indigo plugin on a Windows workstation (refer back to above comments about 'smooth flow'...)

Soooo, am I asking for too much? Should I just get over it and deal with Eclipse, or forget the notion of code completion and and go with a really good text editor with syntax highlighting? What do y'all use? If it's Eclipse, how do you have it setup and use it productively? Matt and Jay feel free to jump in as well!

Edit: I should add that last night I downloaded Jetbrains' PyCharm to try out but haven't used it yet. I love their IDEA ide but hate to pay more for an IDE than I paid for Indigo (again it shows how awesome Indigo is!)... PyCharm is less expensive, so I'm hopeful. Has anyone here used it?

Thanks is advance,
Terry

Posted on
Mon Dec 31, 2012 10:22 am
bschollnick2 offline
Posts: 1355
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: What Python IDEs & practices are you using?

roussell wrote:
I'm having trouble finding a GUI that I'm comfortable with and also finding a system that feels smooth. My environment is Mac Mini running headless in a different part of the house. I open a shared folder on the mini, a screen sharing session to see the desktop should I need it, run the Indigo console on my workstation (13" MB Air most of the time) connected to the mini, and then a Python coding environment of some sort. I find myself constantly switching between them all while coding/deploying/testing/reverting/etc. I've tried running a trial version of Indigo on my workstation and that helps a little with switching around, but I have no devices on the trial copy so that approach has very limited value. I'm wondering if anyone else has run into anything similar and if so how did you overcome it?

As to an IDE - I've tried several but the ones that felt intuitive had lacking Python support. The ones with good Python support felt kludgy (at least to me). I should start by saying that I hate Eclipse. We use it at work for Java development and I simply can't stand it. I've tried several variants of it - Aptanna, Spring, Tibco, etc. and they're all basically the same to me - when using Eclipse I feel like I'm trying to herd cats. Eclipse has great support for Python (using PyDev) but I just don't mesh with it like I feel I should. I have Active State's Komodo IDE (the paid-for version) which is what I use most often , for me it's better than Eclipse, but I still don't know if it's ideal. I like Panic's Coda for other stuff, but it doesn't work well for Python. Likewise other text editors with syntax highlighting like BBEdit, Text Wrangler, Textmate are good at what they do, but they're missing code completion, run-time debugging and other features that true IDEs have. It would be sweet if XCode had proper Python support, but alas nothing after all these years... Sadly the tool that feels best is Microsoft's Visual Studio (iron Python), but I no longer have Windows machines in the house plus I would imagine it would be a true nightmare to develop an Indigo plugin on a Windows workstation (refer back to above comments about 'smooth flow'...)

Soooo, am I asking for too much? Should I just get over it and deal with Eclipse, or forget the notion of code completion and and go with a really good text editor with syntax highlighting? What do y'all use? If it's Eclipse, how do you have it setup and use it productively? Matt and Jay feel free to jump in as well!

Edit: I should add that last night I downloaded Jetbrains' PyCharm to try out but haven't used it yet. I love their IDEA ide but hate to pay more for an IDE than I paid for Indigo (again it shows how awesome Indigo is!)... PyCharm is less expensive, so I'm hopeful. Has anyone here used it?


This is a tricky one.

My suggestion is to look at TextWrangler or BBEdit, before you commit to a IDE. FYI, TextWrangler is effectively the Free or "Lite" version of BBEdit.

I am not much of an IDE person, although, I started with Borland's IDE way way back, and loved it. But I have not yet found a modern IDE that I have felt comfortable with. Instead I have TextWrangler open with multiple files, and syntax coloring loaded, and an Unix terminal window open. This way I can run the application and see what happens in the Terminal window, and modify the file in the TextWrangler window.

Please keep in mind, an Indigo plugin won't be able to run inside an IDE, since it's importing content from Indigo. So the IDE won't be able to import the Indigo related modules, and will display an error.

- Ben

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Posted on
Mon Dec 31, 2012 11:47 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: What Python IDEs & practices are you using?

I do like PyCharm, but as Ben mentioned it cannot debug into an Indigo plugin (or script) because the plugin's python has to run within the Indigo Plugin Host framework with provides the Indigo Object Model / APIs (and connectivity to the Indigo Server).

Lately I've been using Sublime for python development. It has a good Lint plugin available which catches/highlights potential coding errors. There is a bit of a learning curve to getting setup and comfortable with Sublime, but once you do it is very slick and fast.

Image

Posted on
Mon Dec 31, 2012 12:16 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: What Python IDEs & practices are you using?

Thanks guys, I actually just stumbled on Sublime Text 2 (and came back here to mention it when I saw Matt's post) and intend to DL it and try it out tonight. There is an interesting video about some of it's features on youtube: http://www.youtube.com/watch?v=wyUjnPgOPGE

I've used Textmate for a long time but it hasn't been updated in a while and the Alpha 2 version seems perpetually stuck. Since I'm a VIM user from way back I always liked Textmate because of it's simple feel and the ability to do a lot with the keyboard. Sublime seems to do the same but go much further with it. @bschollnick2 - Textwrangler is nice, I have used it but was looking for a little 'more' (please don't ask me to define 'more' :? )

Work has been painfully slow today so I decided to have an open mind and give the latest Eclipse a try (4.2.1 with the PyDev plugin). 4.2 has a new interface that looks a little more modern and feels a little easier to work with. Perhaps I'll give that another shot too for when I need a bigger IDE.

It would be interesting (if it's even possible) to design a plugin and/or proxy for some IDE - whether its Sublime, Coda, Komodo, Eclipse, whatever to properly integrate with the IOM. I suppose Eclipse would be the better choice there as it's open source, very plugin-able and free. Sublime could be a possibility too.

Today since posting I also ran across Coderunner: http://krillapps.com/coderunner/ which seems interesting as well. It's only $10USD from the Mac App store so it too might be worth checking out.

I think one of my bigger problems is that I'm trying to do everything from the 13" screen of the MBAir. In the previous house I had a dual monitor setup going with a Mac Pro but I've been trying out this minimalism thing since moving into the new house. I may have to grab an external monitor to go with the MBAir and confine the bulk of Indigo dev/playing to the desk. That alone may solve some of my more procedural/ergonomic issues...

Thanks, keep 'em coming. NSheldon, what do you use?

Terry

Posted on
Mon Dec 31, 2012 1:19 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: What Python IDEs & practices are you using?

I love PyCharm though I'm not using it for plugin development. At some point I'd really like to see if I can do more integration with it though.

I too have been using TextMate for years but recently switched to BBEdit - though it's not nearly as easily extensible. I may try Sublime once Matt gets more comfortable with it and has some of the integration done... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Dec 31, 2012 6:03 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: What Python IDEs & practices are you using?

I have been using TextWrangler for a while (Jay or Matt's recommendation, I can't remember which) and find it Ok as a general editor, but not an IDE. As Ben and others have noted, not having an IDE is not much of a disadvantage for plugin development and that is mostly what I have been doing. TextWrangler does have a Python aware syntax checker and you can run code in a debugger (but not plugin code).

If someone were to create an Indigo IOM aware IDE/Editor I would give it a serious look. But, in the meantime I have gotten pretty good at Save in TW, switch to Indigo, reload the plugin, read the errors from the events window, and edit again.

Actually, what would help would be an Indigo macro so reload plugin foo could be done in a keystroke.

BTW, I started on ed and then switched to vi (never liked emacs) and sometimes STILL hit the escape key after entering text.

Posted on
Mon Dec 31, 2012 7:10 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: What Python IDEs & practices are you using?

berkinet wrote:
Actually, what would help would be an Indigo macro so reload plugin foo could be done in a keystroke.


I have such a build command setup in Sublime for CMD+B. It is a shell script that takes an argument which is the path to the main plugin folder you want to restart. It had some dependencies in it based on my development environment which I tried to edit out, but I haven't tested it:

Code: Select all
#!/bin/sh
#

PLUGIN_FOLDER="$1"
if [ ! -d "$PLUGIN_FOLDER/Contents/Server Plugin" ]
then
   echo
   echo "usage: restart_plugin <PLUGIN_FOLDER>"
   echo
   exit 1
fi
# echo "PLUGIN_FOLDER is $PLUGIN_FOLDER"

SERVER_APP="IndigoServer.app"
SERVER_INSTALL_PATH="Perceptive Automation/Indigo 6"
SERVER_PLUGINHOST="IndigoPluginHost.app"

INFOPLIST_FILE="$PLUGIN_FOLDER/Contents/Info.plist"
# echo "INFOPLIST_FILE is $INFOPLIST_FILE"

PLUGIN_ID=`/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$INFOPLIST_FILE"`
PLUGIN_NAME=`/usr/libexec/PlistBuddy -c "Print :CFBundleDisplayName" "$INFOPLIST_FILE"`
# echo "PLUGIN_ID is $PLUGIN_ID"
# echo "PLUGIN_NAME is $PLUGIN_NAME"

# --------------------------------------------------------------
#
appRunningCount()
{
   APP_RUNNING_COUNT=`ps -axww | grep "$1" | grep -v "grep" | grep -v "launchctl" | wc -l`
   return $APP_RUNNING_COUNT
}

appRunningCount "$SERVER_APP"
if [ $? -eq 0 ]
then
   echo "Error: $SERVER_APP was not running"
   exit 1
fi

# --------------------------------------------------------------
PY_SCRIPT=`cat <<EOF
plugin = indigo.server.getPlugin("$PLUGIN_ID")
if plugin.isEnabled():
   plugin.restart()
   return "Plugin $PLUGIN_NAME Restarted"
else:
   return "Error: Plugin $PLUGIN_NAME Not Enabled"
EOF`

cd "/Library/Application Support/$SERVER_INSTALL_PATH/$SERVER_PLUGINHOST/Contents/MacOS/"
./IndigoPluginHost -e "$PY_SCRIPT"

Image

Posted on
Mon Dec 31, 2012 7:31 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: What Python IDEs & practices are you using?

matt (support) wrote:
I have such a build command setup in Sublime for CMD+B. It is a shell script that takes an argument which is the path to the main plugin folder you want to restart.

Very cool. Makes complete sense. THANKS

and HAPPY NEW YEAR

Posted on
Mon Dec 31, 2012 8:12 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: What Python IDEs & practices are you using?

Happy New Year to you and everyone else!

Image

Posted on
Mon Dec 31, 2012 9:42 pm
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: What Python IDEs & practices are you using?

matt (support) wrote:
berkinet wrote:
Actually, what would help would be an Indigo macro so reload plugin foo could be done in a keystroke.


I have such a build command setup in Sublime for CMD+B. It is a shell script that takes an argument which is the path to the main plugin folder you want to restart. It had some dependencies in it based on my development environment which I tried to edit out, but I haven't tested it:

Code: Select all
#!/bin/sh
#

PLUGIN_FOLDER="$1"
if [ ! -d "$PLUGIN_FOLDER/Contents/Server Plugin" ]
then
   echo
   echo "usage: restart_plugin <PLUGIN_FOLDER>"
   echo
   exit 1
fi
# echo "PLUGIN_FOLDER is $PLUGIN_FOLDER"

SERVER_APP="IndigoServer.app"
SERVER_INSTALL_PATH="Perceptive Automation/Indigo 6"
SERVER_PLUGINHOST="IndigoPluginHost.app"

INFOPLIST_FILE="$PLUGIN_FOLDER/Contents/Info.plist"
# echo "INFOPLIST_FILE is $INFOPLIST_FILE"

PLUGIN_ID=`/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$INFOPLIST_FILE"`
PLUGIN_NAME=`/usr/libexec/PlistBuddy -c "Print :CFBundleDisplayName" "$INFOPLIST_FILE"`
# echo "PLUGIN_ID is $PLUGIN_ID"
# echo "PLUGIN_NAME is $PLUGIN_NAME"

# --------------------------------------------------------------
#
appRunningCount()
{
   APP_RUNNING_COUNT=`ps -axww | grep "$1" | grep -v "grep" | grep -v "launchctl" | wc -l`
   return $APP_RUNNING_COUNT
}

appRunningCount "$SERVER_APP"
if [ $? -eq 0 ]
then
   echo "Error: $SERVER_APP was not running"
   exit 1
fi

# --------------------------------------------------------------
PY_SCRIPT=`cat <<EOF
plugin = indigo.server.getPlugin("$PLUGIN_ID")
if plugin.isEnabled():
   plugin.restart()
   return "Plugin $PLUGIN_NAME Restarted"
else:
   return "Error: Plugin $PLUGIN_NAME Not Enabled"
EOF`

cd "/Library/Application Support/$SERVER_INSTALL_PATH/$SERVER_PLUGINHOST/Contents/MacOS/"
./IndigoPluginHost -e "$PY_SCRIPT"


Thanks for the reload script Matt, I'm really liking Sublime Text so I'm gonna give it a try for a while. I like all of the keyboard shortcuts, and the amount of packages (plugins) available is great. I installed the 'Package Control' package and it literally give me hundreds of extra packages available with a just a few keystrokes. The multi-line edit is the best I've ever used and real-time linting is really sweet. The fact that packages are written in Python is also a nice bonus.

@berkinet - I could never get used to emacs either. It's funny, fellow geeks in the '90s told me I was insane for not liking emacs, now the same ones tell me I'm insane for not liking Eclipse...

Happy New Year fellow Indigoers!

Terry

Posted on
Sun Jan 06, 2013 9:25 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: What Python IDEs & practices are you using?

If anyone is interested, I wrote a quicky Sublime plugin that gets the path of the current file and then passes it to the (slightly modified) shell script Matt posted.

The plugin should probably run a short AppleScript to bring the Indigo Events window into focus. But, otherwise, I think its done.

PM me with your email interest and I'll mail you a copy of the plugin and modified shell script.

EDIT: The AS add was simple. I can now invoke the macro from a contextual menu, from the Tools menu or by Ctrl-Option-i, as soon as the reload starts, the Indigo Events window pops into focus. :D

Posted on
Sat Jan 12, 2013 11:59 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: What Python IDEs & practices are you using?

Snippets in Sublime are great and use TextMate syntax. I just started with some for debugging/logging and I envision a few for XML as well. Matt... you must have a few worthy snippets :wink: you might want to share with us?

That plus 2 clicks to reload the plugin in Indigo and switch to the Indigo EVents log makes Sublime a winner. Just paid for my license today.

Posted on
Sun Jan 13, 2013 12:15 am
gtreece offline
Posts: 171
Joined: Sep 26, 2011

Re: What Python IDEs & practices are you using?

berkinet, are you doing all your development directly on your Indigo server then?

Posted on
Sun Jan 13, 2013 12:19 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: What Python IDEs & practices are you using?

Yup. It'd be nice to have a development machine, but, this works.

Posted on
Mon Jan 14, 2013 9:59 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: What Python IDEs & practices are you using?

berkinet wrote:
Snippets in Sublime are great and use TextMate syntax. I just started with some for debugging/logging and I envision a few for XML as well. Matt... you must have a few worthy snippets :wink: you might want to share with us?

I'm not yet using snippets. I aspire to be a Sublime power user but am definitely not there yet. :-) I have on my ToDo list to watch more of those good video tutorials...

Image

Who is online

Users browsing this forum: No registered users and 5 guests