1- How to install Python 2.1.1 on your Macintosh
1+ How to install Python 2.2a2 on your Macintosh
22---------------------------------------------
33
44This is a MacPython that can run on classic MacOS (from 8.1
55onwards) and natively on MacOSX. The installer tries to work out whether you can
66use the Carbon version or not.
77
8- You should definitely read the Relnotes file too.
8+ You should definitely read the Relnotes file too, and the section below about
9+ toolbox module reorganization.
910
1011A special note about the active installer: do not background it, it may hang
1112your machine. This is a general problem with Vise active installers, MindVision
1213are working on it.
1314
15+ Aside from the general new Python 2.2a2 listed in the general relnotes file
16+ there is some other new machine-independent stuff in this release as well, as
17+ it was built from newer sources than unix/windows 2.2a2.
1418------
1519
1620If this is your first encounter with Python: you definitely need the
@@ -24,18 +28,88 @@ Mac-specific documentation is included in this distribution in folder
2428Mac:Demo. The documentation is sparse, but it will have to serve for
2529now. The documentation is in HTML format, start with index.html.
2630
27- Caveats
28- -------
29- Aside from the general new Python 2.1.1 features compared to 2.0 the main
30- feature of this release is Carbon support.
31-
3231This installer installs MacPython for classic PPC MacOS, MacPython for Carbon
3332(OS X, OS 9 or OS8 with CarbonLib installed) or both, depending on your
3433configuration. By selecting custom install you can bypass these tests and
3534install what you want.
3635
3736If you want 68k support you will have to stay with MacPython 1.5.2.
3837
38+ Toolbox module reorganization and more
39+ --------------------------------------
40+
41+ You can safely skip this section if this is your first encounter with MacPython.
42+
43+ I am working on a new organization of the mac-specific modules, and in
44+ general bringing the MacPython folder structure more in line with
45+ unix-Python. This is not only a good idea, it will also immensely
46+ facilitate moving MacPython functionality to an OSX Python that is based
47+ on Mach-O and the unix-Python distribution. But don't worry: MacPython
48+ is definitely not dead yet, and the hope is that the transition will be
49+ as seamless as possible.
50+
51+ First a change that should not cause too much concern: :Mac:Plugins has
52+ gone, and most of the dynamically loaded modules have moved to
53+ :Lib:lib-dynload.
54+
55+ Second, and more important: the toolbox modules, such as Res and
56+ Resource, have moved to a Carbon package. So, in stead of "import Res"
57+ you should now say "from Carbon import Res" and in stead of "from Res
58+ import *" you should use "from Carbon.Res import *". For the lifetime of
59+ MacPython 2.2 there is a folder :Mac:Lib:lib-compat on sys.path that
60+ contains modules with the old names which imports the new names after
61+ issuing a warning.
62+
63+ Note that although the package is called Carbon the modules work fine under
64+ classic PPC, and they are normal classic modules. Also note that some
65+ modules you may think of as toolbox modules (such as Waste) really are not,
66+ and they are not in the Carbon package.
67+
68+ Some open issues I would like to discuss on the PythonMac-SIG, please join
69+ in if you have views on the matter:
70+ - Is this all a good idea?
71+ - Some modules are not in the Carbon package (icglue, for instance, or
72+ supporting module such as aetools and aepack) and maybe they should be,
73+ some are (ControlAccessors) which arguably should not. Opinions are welcome.
74+ - I'm tempted to put Qt and QuickTime into their own package, especially
75+ since I'm also working on porting it to Windows. It would also be in line
76+ with Apple's organization. Opinions?
77+ - Should we get rid of the Res/Resource dichotomy, where the first is the
78+ extension module and the second is the Python module with the constants?
79+ We could simply import the extension module functionality into the Python
80+ module, at the expense of a rather large namespace.
81+ - Should we have a Carbon.Carbon module that simply imports the whole world,
82+ so that "from Carbon.Carbon import *" is pretty much equivalent to the C
83+ #include <Carbon/Carbon.h>?
84+ - Should we put all the other Mac modules into a Mac package? This will make
85+ MacPython programs a lot more verbose, but that is a good thing too if people
86+ try to port Mac Python scripts to other platforms.
87+ Should the Carbon package then be a sub-package of the Mac package?
88+
89+ Another change related to the OSX growth path is that there is a new module
90+ macresource that you can use to easily open a resource file accompanying your
91+ script. Use "macresource.need("DLOG", MY_DIALOG_ID, "name.rsrc") and if the
92+ given resource is not available (it _is_ available if your script has been
93+ turned into an applet) the given resource file will be opened. This method will
94+ eventually also contain the magic needed to open the resource file on
95+ OSX MachO Python.
96+
97+ ... and more
98+ ------------
99+
100+ A feature that I am not sure about (so: feedback!) is that if you open a textfile
101+ for reading MacPython will now accept either unix linefeeds (LF, '\n') or
102+ Macintosh linefeeds (CR, '\r') and present both of them as '\n'. This is done on
103+ a low level, so it works for files opened by scripts as well as for your scripts
104+ and modules itself.
105+
106+ But:
107+ - this works only for input, and there's no way to find out what the original
108+ linefeed convention of the file was.
109+ - this is unconditional, so there's no way to turn it off, either on a file-by-file
110+ basis or globally (but opening binary files works as it always has, of course).
111+ - Windows \r\n linefeeds are not supported and get turned into \n\n.
112+
39113What to install
40114---------------
41115
@@ -44,7 +118,7 @@ The optional parts in this distribution are
44118 package (allows you to read, write and display images and do lots of operations on them).
45119 For Carbon MacPython you only get PIL: there is no Tcl/Tk for Carbon yet.
46120 This is the reason Classic MacPython is also installed on MacOSX: it allows you
47- to run Tkinter applications, albeit in the MacOS9 box.
121+ to run Tkinter applications, albeit in the Classic box.
48122- img: another imaging package. Has more file format support and is faster
49123 than imaging, but has only limited operations on images. There is a bridge
50124 between the packages.
@@ -104,7 +178,7 @@ Uninstalling
104178
105179Two items are installed in the system folder: the interpreter shared
106180libraries PythonCore and PythonCoreCarbon lives in the Extensions folder and the
107- "Python 2.1.1 Preferences" file in the Python subfolder in the
181+ "Python 2.2a2 Preferences" file in the Python subfolder in the
108182Preferences folder. All the rest of Python lives in the folder you
109183installed in.
110184
@@ -113,7 +187,7 @@ in OSX that is triggered by Python: if any orphaned aliases are left in
113187/Library/CFMSupport your machine will start to behave very badly. 2.1
114188beta installers triggered this problem if you simply threw away your Python folder,
115189so if you installed a 2.1beta you should clean out the aliases in /Library/CFMSupport
116- too. The final 2.1 installer always copied the shared libraries on OSX, so it does
190+ too. The final 2.1 and 2.1.1 installers always copied the shared libraries on OSX, so it does
117191not have the problem anymore.
118192
119193Things to see
@@ -153,11 +227,11 @@ that this means you can keep your older version around if you are unsure
153227whether to upgrade. The bad news is that your old preference settings
154228are lost and you have to set them again.
155229
156- After you are satisfied that 2.1.1 works as expected you can trash
230+ After you are satisfied that 2.2a2 works as expected you can trash
157231anything in the system folder that has "python" in the name and not
158- "2.1.1 ".
232+ "2.2a2 ".
159233
160- As of 2.1 the ConfigurePython applets will try to detect incompatible preferences
234+ The ConfigurePython... applets will try to detect incompatible preferences
161235files and offer to remove them. This means that re-running ConfigurePython after
162236a second install of the same MacPython version (or after moving the Python folder)
163237should fix things up correctly.
0 commit comments