I’m keeping a more thorough accounting of my journey through learning Python (which I’ve opted to learn at the same time as Ruby on Rails—I must be out of my mind) for personal blog entries. Being new to these languages, I first started learning by simply using Notepad++, but quickly found it tedious. I assumed others here on ChurchMag might be in the same boat, so undaunted, I went in search of an integrated development environment (IDE) for Python.
That’s when I discovered Ninja-IDE.
It’s really no secret professional developers cling to their favorite integrated development environment (IDE) with almost religious zeal. Personally, I’m not too picky. I prefer four key parts to my IDE:
- Runs on multiple operating systems
- Easy set-up
- Code completion
- Rich text-editing and manipulation features
When I first dug around looking for a good Ruby on Rails editor, I heard a lot of hooting for Aptana’s RadRails. That seemed like overkill for learning purposes, so I settled on SublimeText 2, instead.
So Comes Ninja-IDE
When it came to Python, however, the answers and opinions were as varied as all of the forums I trolled. One consistent theme seemed to be, however, don’t use IDLE—the integrated shell GUI and editor that comes with the Python installation routines. Then one obscure post caught my eye about an editor called Ninja-IDE, which is a recursive acronym for “Ninja-ide Is Not Just Another IDE.” Cute, eh? Intrigued by the website, I downloaded and installed it immediately. (Note: The instructions for the Windows installer looked like they were maybe in Spanish or Italian—don’t let that phase you.) I was greeted with this screen upon opening it:
Now I don’t claim to be a Python expert by any stretch, neither would I attempt to claim an expertise in all the IDEs available for programming in Python. I am, however, a veteran programmer. I feel Ninja-IDE showed great promise for all the reasons I cited above in my introduction. Ninja-IDE includes compatibility with the following OS platforms:
- Linux Ubuntu/Debian and Fedora
- Windows XP, Vista, 7
- Mac OsX (Lion & Snow)
- Source Code (for any OS) available via GitHub
Next, I added a new script by clicking the top icon to the left. This was immediately intuitive to me. I then typed the following code, purposely leaving out some basic syntactical items or using non-standard conventions (such as no space between my string elements in the phonetics list):
To my complete amazement, it ran the script but it did highlight through the yellow squiggly lines all of the syntax errors. It also threw a debugging message “IndentationError: unexpected indent.” Of course, the exception was thrown not because of the indentation (which is actually correct for a statement block in Python 3.x), but because I omitted the colon after the “for p in phonetics” statement. By hovering my cursor over the statement in file, I got a “syntax error” message, making the debugging experience even richer!
Finally, I fixed all of my errors and ran it again. The results were pretty with no errors and nice, vibrant (in Lime color) “Execution Successful” message.
Just for my own satisfaction, I then clicked the terminal button and found myself at the Python terminal prompt. On a whim, I ran the exact same code and got the results I would expect to see if running Python from a command prompt, or IDLE (or within PowerShell, as one instruction book on Python suggests). Here are the results:
All told, I’ve had great experiences using Ninja-IDE. Thus far, it appears to have all the things I like in an IDE, and it’s simplistic enough for learning Python as well as serving a number of professional development needs. So my recommendation is to go to http://ninja-ide.org/ and get the tool for your own use. Especially if you’re a newcomer to Python.
God bless and happy coding!