Making the switch to Python
At last year's Emerging Tech Conference I attended the OSAF presentation about Chandler where Andy Hertzfeld talked about using various programming languages:
Java was cool -- I could program twice as fast in Java as I could in C++. And now I can program twice as fast with Python as I can with Java.
(That quote is paraphrased; sorry if I butchered it, Andy) That was the Python tipping point for me. Too many cool people all had so many positive things to say about Python and being able to code several times faster than C++ really resonated with me.
Now 9 months later, I've finally written my first decent sized Python application. Its a tool that will make it easier for me to post photos to my MovableType photoblog. Not surprisingly this little application took only a few hours to write -- even with the GUI dialog that gets all the pertinent info about a photo, creating and uploading/thumbnails and posting the entry to my blog.
I've been frustrated with C++ for quite some time. It is butt-ugly. Its hacked. Template compilation takes forever and eats all of your RAM. When all we really had was C, C++ was a great tool. But now that we have choices, I can hardly believe we ever put up with a tool like C++.
Python is elegant and fun. Learning Python has presented the perfect learning curve for me -- if I don't know how to do something, just try it. And 9 times out of 10, it works -- Python is quite intuitive and the docs are great.
I'm even more pleased with wxPython, the wxWindows Python bindings. Writing GUI applications is a pain enough, much less having to do it over and over for different platforms. wxWindows is a really nice cross platform toolkit and combining it with Python is the killer development platform I've been looking for. The next major application will be to write a cross-platform music tagging application to replace the MusicBrainz Tagger. I'm stoked that I will have one codebase that will run on all three major platforms.
The only snag so far was finding a good way to make wxPython applications behave like real Mac OS X applications. I want to drag a photo out of iPhoto onto the application icon and have it launch my wxPython application. DropScript refuses to start the application. ScriptGUI and PythonLauncher are kludgey and won't allow me to drop a file ono the application icon. What is the best way to make a wxPython application behave like a Mac application? Please hit the talk-back link below if you have some tips for me.
I'm having a great time with Python. I haven't had this much fun since I discovered perl.
Got any tips for making wxPython apps behave like real Mac OS X applications?
Categories
WebComments (6)
Read More Entries by Robert Kaye.

Give pyQt a try..
If you haven't tried pyQt then you are missing out..
Anthony
Have you tried Platypus?
I haven't yet done any work with wXpython on OS X, and I'm not sure that you won't encounter the same problem that you found with DropThing, but you might want to give Platypus a try:
http://sveinbjorn.vefsyn.is/platypus
Good luck!
photoblogging script
You've got a script for posting images to a moveable type photoblog? Any chase you'd be willing to share the source? I'm in the middle of a script for that myself, but I'm having some weird concurrency problem with the ftp library and I'd rather just dodge the issue.
I share your frustration regarding wxPython's lack of drap&drop support on OS X. I've built a little app which lets you paste in text, automatically generate an iCal event via date scraping, and then drag the event into Palm Desktop, Mozilla Calendar, or Palm Desktop. It works fine -- but the drag & drop's only good for Windows.
You think that's nice?
Just give Gtk2-Perl a spin.
Might be of interest...
Bit tangential perhaps, but I've written a couple of rough little MacPython scripts for iPhoto you might find of interest:
http://freespace.virgin.net/hamish.sanderson/appscript.html
('Info for selected photos', 'iPhoto to HTML')
Some tips and tricks
Your message prompted me to start a wiki page on the wxPython site about optimizing apps for OS X. Here is the first draft, and I'd appreciate any suggestions you may have:
http://wiki.wxpython.org/index.cgi/Optimizing_20for_20Mac_20OS_20X
Also, as for making wxPython apps a drop target for files, that's not yet possible but the wxPython maintainer is aware of this and plans to make this feature available in the near future. You may want to sign up for the wxPython-mac or wxPython-dev mailing lists to be notified of updates about this.
wxPython for Mac is relatively new compared to its Linux and Windows counterparts, so there are little glitches here and there to be ironed out, but we're working on them! =) In any case, glad to hear the tools are working out so well for you!