Re: [Pyobjc-dev] Python rather than ObjC for main?
Brought to you by:
ronaldoussoren
|
From: Ronald O. <ous...@ci...> - 2002-11-06 19:35:12
|
I've repeated your experiment and see the same problem. The problem
seems to be caused by a wrong mainBundle. I've added the following
lines to the start of the python script:
import objc
print sys.argv[0]
print objc.lookup_class('NSBundle').mainBundle().bundlePath()
The first print statement emits the full path of the script inside the
.app bundle. The second line prints /usr/local/bin, which is where my
python interpreter is living.
Ronald
On Wednesday, Nov 6, 2002, at 15:23 Europe/Amsterdam, Peter Montagner
wrote:
> Is there any reason why the executable pointed to by
> CFBundleExecutable has to be a Mach-O file?
>
> As a quick test I threw the HelloWorld.py example into a .app Bundle,
> copied and edited a reasonable Info.plist and I now have a double
> clickable version of hello world that still doesn't use any C code.
>
> I just added #!/usr/bin/env python to the top of HelloWorld.py and ran
> chmod +x on it.
>
> Now, I've been experimenting with making a modified Main.py the
> CFBundleExecutable, hoping to avoid the execve(). I can't seem to get
> it working though. NSApplicationMain() dies complaining about not
> finding the Info.plist file. I'm not sure I understand what's
> happening. The launch arguments seem to carry across OK.
>
> Am I reinventing the broken wheel here? Do we have the execve()
> procedure because the simpler approach fails?
>
> Obviously this approach would be inferior to having an embeddable
> version of python in an ObjC wrapper but could this approach be used
> to remove the execve()?
>
> Just a thought,
> Peter
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: See the NEW Palm Tungsten T
> handheld. Power & Color in a compact size!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
> _______________________________________________
> Pyobjc-dev mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev
>
|