[Pythonmac-SIG] unix link to framework python

Robin Dunn robin@alldunn.com
Mon, 27 Jan 2003 13:48:17 -0800


Chris Barker wrote:
> Robin Dunn wrote:
> 
>>I think it would be better if the link was
>>"python2.3" and then there could be a separate link from "python" to
>>"python2.3" as well.  This would allow command line (or #!) users to
>>specify either "python2.2" or "python2.3" to get the one they want.
> 
> 
> Here! here! (hear! hear! ?)
> 
> 
> This is critical. On Linux I have at least three versions of Python
> installed at once, and I now have two on OS-X and will be adding more. I
> can't experiment with 2.3 unless it is set up this way (I know I can do
> it by hand, and probably will)

I've made an Installer package for MaxPython-OSX 2.3a1 that has a 
postinstall script that sets up the links as I described above.  You can 
get it at the wxPython Files page at SF:
	https://sourceforge.net/project/showfiles.php?group_id=10718
(look near the bottom.)  BTW notice the huge file size difference 
between the 2.3a1 build and my previous 2.2.1 build!  That's the result 
of not including the .pyc/.pyo files and then regenerating them in the 
postinstall.  I havn't yet tried including the Python docs, but will 
when I get some more time.

Right now I'm working on an Installer package for wxPython that works 
with the Ptyhon 2.3a1 above and also installs app bundles for running 
the demo, PyShell, and etc.  So far so good, I just need to look into 
how to create the resources in the bundle for setting the Icon...

> 
> We are still missing a step however. If I have it right, you can tell
> finder that you want a *.py or *.pyw file opened with (*and run by) the
> python interpreter. What would be great is if that file go opened be a
> samll utility that looked at the #! line and opened it with the correct
> interpreter (I suppose that utility could be a simple shell script, come
> to think of it). That way, one could have programs written for various
> versions of Python all on one machine, and be able to run them easily
> from the GUI. I suppose BuildApplet (if it exists for OS-X) can do the
> same thing, but I kind of like the cross-platform elegance of the #!
> line. The Windows folks could do the same thing as well...

It's not quite the same but if you set the properties such that are 
using the PythonLauncher from 2.3 then if you hold down the Alt key 
while double clicking a .py or .pyw file in Finder then you will get an 
opportunity to specify which python is executed.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!