On 19 Apr, 2011, at 11:40, Georg Seifert wrote: > Hi, > > I have an app written in cocoa and run python scripts from within the app > using "PyRun_SimpleString" (I asked about that a couple of times and got > great help). > > My problem now is that I want to use some c functions from within a custom > framework that is embedded in my app. The only way I could get it to work is > to load the bridgesupport file manually: > > _path = objc.pathForFramework('../Frameworks/MyFramework.framework') > f = > open(_path+'/Versions/A/Resources/BridgeSupport/MyFramework.bridgesupport') > objc.parseBridgeSupport(f.read(), globals(), > _path+'/Versions/A/Resources/BridgeSupport/MyFramework.bridgesupport') > f.close() > > I have to put this in the script for every run. Is there a better way to tell > python to pick the file up automatically?
You will always have to do something to load the bridgesupport data. You might be able to use "objc.initFrameworkWrapper", that function will load the embedded bridgesupport file. This function is usually used to also load the framework, but when you specify the framework identifier it wouldn't do that when the framework is already loaded. Ronald Ronald
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG