Fooling around in the Python(x,y) documentation a little bit, I found some cool GUI tools I thought would be worth looking into, and I discovered that I my initial judgements of the Eclipse IDE were a bit un-founded and unnecessarily harsh. From what I’ve heard from Mac users trying to use PTK and Spyder, they haven’t had much luck, and it’s a bit of a challenge, so I would highly recommend Eclipse for Mac users, and it’s got some nice features that may even convince non-Mac users like myself to adopt it.
Qt Designer: One awesome thing about Eclipse is that it has the Qt Designer built in! This makes it extremely easy to make GUIs. Here’s a screenshot of a simple project I’m working on:
For those who don’t know, Qt is a really nice cross-platform GUI library, so this will create a nice GUI that will work on Mac, Linux, and Windows. It’s really pretty sweet, especially with the Designer so you can organize things visually. I’m beginning to like programming in Eclipse, but for those who aren’t sold, Qt Designer comes in a separate application, so you can always install that and write your code in whatever you want.
I also found that my initial complaint about Eclipse being slow was false. I timed Spyder and Eclipse in a cold start load, Eclipse actually loaded 10 seconds faster than Spyder (15 seconds for Eclipse, 25 for Spyder), both loaded in about 2 seconds in a “warm start” comparison. Neither is as light as PTK, but they both have a lot more features.
Some other advantages for Eclipse: It can also be used for a lot of other languages (C/C++ and Java to name a few), it has excellent code-completion, and it’s more stable than Spyder or PTK, since it is much more widely used. These advantages all work as a slight disadvantage as well, at least when comparing to Spyder, which was designed specifically for scientific computing. This means Spyder is an exceptional MATLAB replacement, while Eclipse is really more of a general programming IDE. It’s not perfect as a replacement for MATLAB, but it’s not hard to make it work either. I hope to get better at GUI programming and post some simple tutorials in the near future.
In case you want to fool around a little bit yourself before I get around to a tutorial, here are some things I’ve found:
- If you have Python(x,y) installed, all you need to do to start playing around is:
- Open up Eclipse and start a new PyDev project
- Right click on the src folder to add a new file (choose other)
- Choose Qt Designer Form for the file type
- Now choose a window type (Main Window, Widget, etc.), and give it a name
- One last thing before you can start playing around, you need to add the Qt Designer bars to your layout. You do this on the menu-bar under Window -> Show View -> Other
- Next choose all of the sub-options under Qt (don’t mind the C++) and move them to wherever you want on the screen (the most important one is the Widget Box, that will let you drag and drop buttons and such)
- There are a few more steps to translating this Qt app into Python code, but I’m still figuring out the best way to do it for my tutorial, so more on that when I finish it
- If you didn’t install Python(x,y) you can install Eclipse and everything else you need following the instructions here.