I have an idea for a Cocoa front-end around a Python script that I recently came across. As you may or may not be aware Cocoa has the concept of a scripting bridge for Python. However, almost all of the examples I could find were to allow Python to use Cocoa as a GUI interface basically. But I want to do is the other way around, use Python for it’s engine from Cocoa. Google being the amazing search engine that it is helped me to find an example that describes exactly that. Using that example I was able to break out the basic concept and build a very simple app that calls a Python script from Cocoa. The python script just calls ls and is then able to print the output back into my Cocoa app’s text view. So the bridge allows a two way communication from Cocoa to Python and back again. This is very cool stuff. Here is a screen shot of my little test app
Here is the Cocoa script that I executed in it’s entirety:
Now that I have a basic understanding of how it all works I can move on to building my little UI.