Thread: [Pyobjc-dev] Using PyObjC to build production apps
Brought to you by:
ronaldoussoren
From: Bill B. <bb...@co...> - 2002-12-04 17:23:09
|
On Wednesday, December 4, 2002, at 04:15 AM, pyt...@py... wrote: > If you are developing a turnkey application I think I would suggest > PyObjC. It can build on the installed /usr/bin/python, and an > application in PyObjC will fit all your requirements (possibly with > the exception of the 2MB download, I'm not 100% sure of that). > Building a fullblown application with PyObjC still has a few rough > edges, but they're being ironed out quickly. As Jack mentioned, there are a couple of rough edges, but PyObjC is definitely a viable means of building standalone GUI applications targeted to MacOSX in Python. If you do decide to delve deeper into PyObjC, please grab the source/examples/etc from pyobjc.sourceforge.net. The current repository contents is way better than the last released version-- many bug fixes, many enhancements to make the programming experience considerably easier and more powerful. Ronald Oussoren has made the interaction between ObjC and Python significantly more seamless and bullet proof than the last release; he has gone so far as to identify and workaround some very subtle/nasty bugs in certain AppKit classes. The examples contained in the repository provide an excellent starting point. In particular, the Web Services Tool and TableModel2 provide complete examples of building PyObjC applications using Project Builder as the IDE. There are also examples that demonstrate building applications without using PB. Just van Rossum has done an incredible job of providing tools to the PyObjC project. In particular, Just contributed a mechanism via which classes defined in interface files [NIB files] are automatically created when the NIB file is loaded. That is, the entire step of keeping your source files in sync with your interface files has been eliminated-- "it just works". In this context, it is less work to build a PyObjC based Cocoa app than a Java or ObjC based Cocoa app! Personally, I'm using PyObjC to build two production quality applications, one of which is relatively complex [it is really a suite of applications that share two frameworks -- one framework of which is almost entirely implemented in Python with a PyObjC bridged layer that the rest of the app uses]. I chose this route not because I like living on the bleeding edge, but because using PyObjC cut a huge amount of gnarly, bug prone, code out of my project and the end result is a more robust applications that performs every bit as well as a pure-C/ObjC counterpart. (Specifically, I replaced the entire web services layer of my application with a python implementation of the web services client. As an added advantage, my python based web services client now works seamlessly across all operating systems / platforms, yet my OS X GUI client remains a pure Cocoa/OS X UI experience.) Very cool stuff -- we have come a long, long way since PyObjC '96! b.bum |
From: David E. <epp...@ic...> - 2002-12-05 23:25:20
|
On 12/4/02 10:42 AM -0500 Bill Bumgarner <bb...@co...> wrote: > As Jack mentioned, there are a couple of rough edges, but PyObjC is > definitely a viable means of building standalone GUI applications > targeted to MacOSX in Python. > > If you do decide to delve deeper into PyObjC, please grab the > source/examples/etc from pyobjc.sourceforge.net. The current repository > contents is way better than the last released version-- many bug fixes, > many enhancements to make the programming experience considerably easier > and more powerful. Ronald Oussoren has made the interaction between > ObjC and Python significantly more seamless and bullet proof than the > last release; he has gone so far as to identify and workaround some > very subtle/nasty bugs in certain AppKit classes. I just grabbed pyobjc itself and was pleasantly surprised -- the project builder's basic cocoa-python project works out of the box and creates very acceptably small standalone binary (at least I'm assuming it's standalone, haven't had a chance to try a different machine without pyobjc installed). I guess the rough edges must be further along because I didn't hit any yet. I intend to try some simple examples before I start working on the larger project I posted about before, but (to answer my previous question of when there will be a usable python for standalone apps) at first glance this looks usable now. The ability to use Cocoa, Project Builder, and Interface Builder directly is probably a fair trade for lack of cross-platform portability. I'm assuming something more would need to be done to get pyobjc applications running on pre-X.2 systems (like, tell users how to install python) but that is only a short-term problem. Quick question on one of those simpler examples I want to try: I'm using a python script (based on JvR's W UI system) to make web pages from my digital camera's photos, and the user interface part is simple enough (a sequence of dialogs with separate windows displaying the photos) that it seems like a good place to start. But has someone already worked on getting Python Imaging Library interoperating with pyobjc and X.2 /usr/bin/python ? I'm not familiar with compiling external modules for Python, but it looks like that part just involves putting PIL's .py and .so files in an appropriate place within the project, the part I'm more worried about is getting PIL images displayed in the Cocoa UI. > The examples contained in the repository provide an excellent starting > point. In particular, the Web Services Tool and TableModel2 provide > complete examples of building PyObjC applications using Project Builder > as the IDE. There are also examples that demonstrate building > applications without using PB. I get not founds when I click on them from pyobjc home -> Examples -> links in sidebar. PyObjC definitely looks good for my purposes, so more documentation and examples would be very useful. I eventually found non-broken links to the examples by browsing cvs, so I guess I can download them that way. -- David Eppstein UC Irvine Dept. of Information & Computer Science epp...@ic... http://www.ics.uci.edu/~eppstein/ |