[Pythonmac-SIG] Is an applet depandant on a single path?
Just van Rossum
Sat, 18 Mar 2000 16:55:59 +0100
At 12:40 AM +0900 19-03-2000, Craig Hagerman wrote:
>I am wondering if the applet created by dropping a script on the
>BuildApplet icon is dependant on the path as set on my machine, or can it
>be used as is on another Mac that has Python installed in a different place.
>I have written a small program for another person and am wondering if it is
>OK to send just an applet or if there will be a problem resulting from the
>path on my machine being different from his. (He has installed Python but
>not done anything with it, and doesn't know a thing about it.) I know that
>I could give him instructions on how to create his own applet but I am just
>curious about whether exchanging applets would cause a problem or not.
It should work, as long as your global sys.path is the default one. If it
isn't, you can drop the applet onto EditPythonPrefs, and override the
global path with your own. This will then travel with the applet. However,
there is (still) some odd problem with EditPythonPrefs: sometimes it adds
an 'alis' reousrce to the applet, which is an alias to *your* Python
installation. In this case the applet won't run on any other machine. The
trick is to just remove the 'alis' resource from the applet with ResEdit.
General applet magic: if you create a resource file in the same folder as
your script, and give it the name of your script, but .rsrc instead of .py,
all the resources in that file will be added to the applet. So if you need
custom preferences, just drop the _resource_ file onto EditPythonPrefs.
Also, if you need custom memory size, the following is handy: create the
applet, set the memory fields in the get info window in the finder, copy
the SIZE resource from the applet to the resource file. If you create the
applet again (say, after editing the script) you applet will have the
proper memory settings.