Re: [Pyobjc-dev] Newer NibLoader.py
Brought to you by:
ronaldoussoren
From: Jack J. <Jac...@or...> - 2002-11-17 00:03:28
|
On zondag, nov 17, 2002, at 00:23 Europe/Amsterdam, Just van Rossum wrote: > #!/usr/bin/env python > > import os > from sys import argv, executable > realmain = os.path.join(os.path.dirname(os.path.dirname(argv[0])), > "Resources", "realmain.py") > argv.insert(1, realmain) > os.execve(executable, argv, os.environ) > > This could be a template, where "realmain.py" is replaced with the > appropriate > filename. (Jack has checked in a modified version into the Python CVS > tree that > fits his needs better. Since it's such a trivial program, I don't > think it's bad > to add our own template.) Is there a reason you like yours better than mine, or does it somehow suit PyObjC better (I haven't looked at it for aeons... something like 3 weeks:-)? I would definitely prefer the MacPython and the PyObjC version of the script to be the same, so if there's a good reason to use this one for PyObjC I'll change the MacPython applet structure to use the name realmain.py too (but convince me first:-). For people who don't track Python CVS: the difference is that in my version I do for name in ["__rawmain__.py", "__rawmain__.pyc", "__main__.py", "__main__.pyc"]: around the os.path.join(....., name). This gives me the current applet naming scheme (__rawmain__, if it exists, will read AppleEvents for ODOC's and stuff them into sys.argv and then call __main__, which can then be a normal unix-style script but still get the files the user dropped on the applet in sys.argv). -- - Jack Jansen <Jac...@or...> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - |