Re: [Pyobjc-dev] Creating python instance in ObjC code [hack working]
Brought to you by:
ronaldoussoren
From: Barry W. <bar...@gm...> - 2007-09-15 01:49:08
|
Glad I could point you in a useful direction. WRT py2app, in fact, I've found that it works like a charm on Intel, but have to revert to py2app 0.3.4 on PowerPC (py2app 0.3.6 seems to generate bundles that don't load on PowerPC; I've reported this previously on the list, but haven't had time to track down the problem or put together a simple test case -- sorry). barry On 9/13/07, Timothy Reaves <tr...@si...> wrote: > Barry Wark wrote: > > Timothy, > > > > If the python class you're trying to use can subclass NSObject, you > > might have a much easier time creating a plugin (using py2app) that > > contains the python classes you want to access from Objective-C. You > > can then use NSBundle to load that plugin. Once loaded, you can get an > > instance to the python class' Class by calling > > NSClassFromString(<PythonClassName>). Once you have this reference, > > you can use it exactly like an object defined in Objective-C. > > > > If the python class you're trying to use doesn't subclass NSObject, > > you can create a wrapper (in python) and call that wrapper from ObjC > > as described above. > > > > > Awesome, thanks for the info! I haven't tried it yet, but I can (and do) > subclass NSObject, so that should work. > > I had heard that py2app had troubles with Intel machines; is this the case? > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |