I recently got a support call from a fellow down in SoCal. He had just started an online course to learn Python. Immediately my mind jumped to Udacity.com, which is the course I'm also taking. Reasonable pricing!
Anyways, my new friend Kelso (names have been changed to protect the innocent from stuck-up judgemental programmers) couldn't figure out why Python wasn't showing up in his Application folder on his Mac. “I checked all the boxes and clicked all the buttons and saw all the files moves! Where is it??”. I told Kelso why his reasoning was incorrect and asked him to email me at the ActiveState support queue. After writing the instructions for Kelso to follow to run and debug his Python script using the free Komodo Edit, I realized that EricP had previously suggested I write a blog about this exact same process; setting up Komodo Edit with Python so that Udacity students could easily run and test their scripts.
That was a few months ago. I figure a sufficient amount of time has passed that I could easily pass this off as my idea, so here it is.
In true programming fashion I chose not to duplicate work and to simply share with you what I shared with my friend Kelso.
Sorry in advance for any spelling/grammatical errors. I wanted to get this back to you post haste....
Nice chatting with you. Here's some information that should help you in working with Komodo to accomplish the tasks laid out in Udacity.
First download Komodo Edit from here: /komodo-edit/downloads
Installation is very straight forward, docs for installation are here: https://docs.activestate.com/komodo/7.1/install.html#mac_os_x
Once you have Komodo installed:
- Start Komodo
- On the Start Page that appears, first click Check Configuration
You should see a green check mark beside Python
- If not, click menu option Komodo->Preferences->Languages->Python
- Click browse
- Type COMMAND + SHIFT + G then you should find the ActivePython interpreter at
/usr/local/ActivePython/bin/, select and open the python file
- Click ok
- Check Configuration again
Once Python is configured, create a new _python_ file; File->New->New From Template, select python from 'All Languages'
Paste your code into the file and save it. Now you'll do a Run Command; https://docs.activestate.com/komodo/7.1/run.html
COMMAND + R (CTRL + R on PC or Linux) will open the Run dialog. In the Run text field type "%(python) %F". That command tells Komodo to run the file currently active in the editor window (%F) using the currently configured Python interpreter (%(python)). Your output or errors will be displayed in the Command Output tab at the bottom of your screen automatically.
HINT: Use print statements to show you information about variables in your program if things don't seem to be working right.
Komodo IDE does real debugging, but it's not free and you might hate programming, so don't buy that yet. There is a free trial though, if you want to check it out.
Let me know if you hit any roadblocks.
Technical Support Engineer
It's as easy as that, though that's just the basics. If you need to know more, the Komodo docs are a fabulous read and our Support Forums are extremely active, with myself and the entire dev team participating in solving problems. I hope you enjoyed my very first blog post...it could very well be my last...