An Epic Introduction to PyObjC and Cocoa. It’s from 2008 but still a nice introduction. Sadly, the option to create a PyObjC project in Xcode 4 is gone. It doesn’t sound like it’s coming along anytime soon.
Following on the previous post, I decided to try something new (for me). I wanted to turn my Safe URL Python script into a services extension. The easiest way I know to make a new services menu item is through Automator. I typically shy away from services because my list of text services is already quite long and disorganized. In this case, I really just wanted to try converting a Python script into a system service.
I need to do this often enough, I wrote a macro with some Python for it. The macro converts a url with invalid characters (such as spaces) to a safe encoded url. Importantly, the forward slashes, colons, question marks, equal signs, quotes and hashes that are necessary to pass queries and parameters are untouched by the conversion.
A common example for me is as follows. Select a URL that has bad actors in it: http://www.
A nice Python module that works well.
A funny thing happened when I was reading through references for Python on OS X. Dr.Drang had a link to Apple's Scripting Bridge page. The funny part is that Apple appears to now redirect that page to the Automator page. It doesn't give me a lot of confidence in learning the Scripting Bridge.
Here's the new home.
It's almost like flashcards for beginner Python users.
http://facts.learnpython.org/all
I wanted a handy way to convert a feed url to the redirected url. For example, Reeder puts this url on the clipboard:
“http://feeds.harvardbusiness.org/~r/harvardbusiness/~3/_folqII9-_8/beware-of-the-short-term-opera.html”
But when I make a post, I want this url:
“http://blogs.hbr.org/hbsfaculty/2011/12/beware-of-the-short-term-opera.html”
There are a number of reasonable ways to do this, but I like Python so that’s what I went with.
It’s a Hack! I’m an inquisitive hack. I know just enough of these technologies to be dangerous.
I’m trying to learn Django and started with the definitive source. The intro includes a brief history of Django, which I found fascinating.
"The World Online team, responsible for the production and maintenance of several local news sites, thrived in a development environment dictated by journalism deadlines. For the sites — including LJWorld.com, Lawrence.com, and KUsports.com — journalists (and management) demanded that features be added and entire applications be built on an intensely fast schedule, often with only days’ or hours’ notice.
Perceptive Automation, the makers of fine mac-friendly home automation devices has announced Python support for Indigo. I think I just found a new winter time hobby.
By way of The Loop
In the never-ending pursuit of hard-won laziness, I often develop scripts to do simple tasks. Sometimes the joy is in the problem solving and sometimes it's in the final product. In this case it was in both.
Yesterday I was working on an as yet to be published post that has a large number of images. My typical workflow is to make an annotation in the text of the image I want to insert.