1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Application written in 10.5 with the Python bridge, will it work on 10.4?

Discussion in 'Mac Programming' started by Monkaaay, Nov 1, 2007.

  1. macrumors 6502


    If I take advantage of xcode 3 and develop an application in Python/Cocoa, will it work on 10.4 or will it require 10.5?
  2. macrumors 6502a

    That depends on whether or not you use any Cocoa features that are specific to 10.5. In addition, Tiger users would need PyObjC and possibly an updated Python interpreter included with the app.
  3. macrumors 6502


    Gotcha, so it's safer to say that Leopard is the target. Thanks for your help.
  4. macrumors regular

    If you want portability between Tiger and Leopard, you'll need to install your own Python framework and develop with that (there's a binary installer for 2.5.1 on www.python.org) and PyObjC (a 1.4 installer is available, or you can find 2.0 in the PyObjC repository).

    To build a standalone application bundle containing a stripped-down interpreter and all dependencies, use py2app. Note that this will add approx 4MB to your .dmg/.zip distribution - basically a non-issue for broadband users and usually tolerable for dialup users.

    Obviously you'll need to avoid using Leopard-only OS features, at least when your application is running on Tiger. If you want to take advantage of Leopard features when available, you could always do a version check at launch and enable/disable the relevant sections of code as needed. You might also be able to find third-party Python and/or Cocoa libraries that provide equivalent features.

    If you'd like to see a typical example of a standalone PyObjC app, take a look at the ASDictionary application on the appscript downloads page (source is also available in svn). You might also want to subscribe to the PythonMac-SIG mailing list if you've not already done so.


Share This Page