mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Updated for 2.0b1
This commit is contained in:
parent
e61aca7d4a
commit
8a6cdccf21
5 changed files with 124 additions and 146 deletions
|
@ -7,11 +7,9 @@
|
||||||
<HR>
|
<HR>
|
||||||
|
|
||||||
This document explains how to build MacPython from source. This is
|
This document explains how to build MacPython from source. This is
|
||||||
necessary if you want to write extension modules for 68K Python, and
|
necessary if you want to make modifications to the Python core. Building
|
||||||
is also necessary if you want to make modifications to the Python core.
|
Python is not something to be undertaken lightly, you need a reasonable
|
||||||
Building Python is not something to be undertaken lightly,
|
working knowledge of the CodeWarrior development environment, a good net
|
||||||
you need a reasonable working
|
|
||||||
knowledge of the CodeWarrior development environment, a good net
|
|
||||||
connection and probably quite some time too. <p>
|
connection and probably quite some time too. <p>
|
||||||
|
|
||||||
The information density in this file is high, so you should probably
|
The information density in this file is high, so you should probably
|
||||||
|
@ -43,49 +41,42 @@ at <A HREF="http://www.cwi.nl/~jack/macpython.html">
|
||||||
http://www.cwi.nl/~jack/macpython.html</A> (which has up-to-date links
|
http://www.cwi.nl/~jack/macpython.html</A> (which has up-to-date links
|
||||||
to the other packages needed too) and possibly also from the standard
|
to the other packages needed too) and possibly also from the standard
|
||||||
<A HREF="ftp://ftp.python.org/pub/python/mac">python.org ftp
|
<A HREF="ftp://ftp.python.org/pub/python/mac">python.org ftp
|
||||||
site</A>. Everything you need is also included in the standard Python
|
site</A>. <BR>
|
||||||
source distribution, but the organization is different. Look in
|
|
||||||
directory <code>Mac/mwerks/projects</code> for the project files and
|
|
||||||
related stuff. <BR>
|
|
||||||
|
|
||||||
An alternative is to check the sources straight out of the CVS
|
A better alternative is to check the sources straight out of the CVS
|
||||||
repository, see below. Most of the packages mentioned here are also
|
repository, see below. Most of the packages mentioned here are also
|
||||||
available through CVS. Check the section on <a href="#cvs">CVS
|
available through CVS. Check the section on <a href="#cvs">CVS
|
||||||
repository use</a> below.
|
repository use</a> below.
|
||||||
|
|
||||||
<LI> You need MetroWerks CodeWarrior. The current distribution has
|
<LI> You need MetroWerks CodeWarrior. The current distribution has
|
||||||
been built with CodeWarrior Pro 4. Ordering information is
|
been built with CodeWarrior Pro 5.2. Ordering information is
|
||||||
available on the <A HREF="http://www.metrowerks.com/">MetroWerks
|
available on the <A HREF="http://www.metrowerks.com/">MetroWerks
|
||||||
homepage</A>. Building Python with MPW or Think/Symantec C is
|
homepage</A>. Building Python with MPW or Think/Symantec C is
|
||||||
probably impossible without major surgery.
|
probably impossible without major surgery.
|
||||||
|
|
||||||
<LI> You need GUSI, the Grand Unified Socket Interface, by Matthias
|
<LI> You need GUSI version 2, the Grand Unified Socket Interface, by
|
||||||
Neeracher. The original CWGUSI is
|
Matthias Neeracher. The original GUSI is obtainable from <A
|
||||||
obtainable from <A
|
HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/src/mw_c">
|
||||||
HREF="ftp://sunsite.cnlab-switch.ch/software/platform/macos/src">
|
ftp://sunsite.cnlab-switch.ch/software/platform/macos/src/mw_c</A>. At
|
||||||
ftp://sunsite.cnlab-switch.ch/software/platform/macos/src</A>.
|
the moment Python is built with a slightly modified version of GUSI
|
||||||
At the moment Python is built with a slightly modified version of GUSI,
|
2.1.1, so it may be better to check the <A
|
||||||
these modifications are available in folder <code>Python:Mac:GUSI-mods</code>. <br>
|
HREF="http://www.cwi.nl/~jack/macpython.html">MacPython homepage</A>
|
||||||
|
for a GUSI that is most easily used for building Python.
|
||||||
|
<br>
|
||||||
|
|
||||||
The modified GUSI is also in the MacPython cvs source repository, in the
|
The modified GUSI is also in the MacPython cvs source repository, in the
|
||||||
directory <code>lib-src/CWGUSI</code>. However, some files contain slashes in
|
directory <code>lib-src/GUSI2</code>. As GUSI is moving to sourceforge
|
||||||
their names, something CVS seriously frowns upon, and each slash has been
|
this info may be outdated by the time you read it so better check the
|
||||||
replaced by <code>"_s_"</code>. There is a script
|
MacPython homepage, probably.
|
||||||
<code>Mac:scripts:fixgusidir.py</code> which you should run after checking CWGUSI
|
|
||||||
out
|
|
||||||
|
|
||||||
</UL>
|
</UL>
|
||||||
|
|
||||||
<A NAME="optional">The MacPython project files are configured to
|
<A NAME="optional">The MacPython project files are configured to
|
||||||
include a plethora of optional modules</A>, and these modules need a
|
include a plethora of optional modules</A>, and these modules need a
|
||||||
number of extra packages. To use the project files as-is you have to
|
number of extra packages. To use the project files as-is you have to
|
||||||
download these packages too. PPC and CFM68K Python have all such modules as
|
download these packages too. Python has all such modules as
|
||||||
dynamically loaded modules, so if you don't need a certain package it
|
dynamically loaded modules, so if you don't need a certain package it
|
||||||
suffices to just refrain from builing the extension module. For static 68K
|
suffices to just refrain from builing the extension module.
|
||||||
Python things are a bit more complicated: you have to edit the
|
Here are the locations for the various things
|
||||||
interpreter project file to remove the reference to the module (and
|
|
||||||
the libraries it uses), and edit the <code>Mac:mwerks:mwerks_nonshared_config.h</code>
|
|
||||||
file to remove the <code>USE_...</code> line. Here are the locations for the various things
|
|
||||||
you need:
|
you need:
|
||||||
|
|
||||||
<UL>
|
<UL>
|
||||||
|
@ -134,7 +125,7 @@ access paths try to set things up as follows:
|
||||||
|
|
||||||
<PRE>
|
<PRE>
|
||||||
Top-level-folder:
|
Top-level-folder:
|
||||||
CWGUSI
|
GUSI2
|
||||||
imglibs
|
imglibs
|
||||||
jpeg
|
jpeg
|
||||||
netpbm
|
netpbm
|
||||||
|
@ -159,25 +150,21 @@ Top-level-folder:
|
||||||
If your setup of the libraries is exactly the same as mine (which is
|
If your setup of the libraries is exactly the same as mine (which is
|
||||||
not very likely, unless you happen to work from the same CVS
|
not very likely, unless you happen to work from the same CVS
|
||||||
repository) you can use the project <code>buildlibs.prj</code> in the
|
repository) you can use the project <code>buildlibs.prj</code> in the
|
||||||
<code>:Mac:build.mac</code> folder to build all needed libraries in one
|
<code>:Mac:Build</code> folder to build all needed libraries in one
|
||||||
fell swoop, otherwise you will have to build the libraries one by
|
fell swoop, otherwise you will have to build the libraries one by
|
||||||
one. <p>
|
one. <p>
|
||||||
|
|
||||||
First build GUSI. If you didn't get the python-specific GUSI you have to
|
First build GUSI. If you didn't get the python-specific GUSI you have to
|
||||||
move the files from the "CWGUSI-mods" to the right
|
massage some of the Python code (missing routines) and you'll miss the
|
||||||
place in the CWGUSI distribution folder. Build the MSL version for your
|
functionality of "delay console".
|
||||||
platform (ppc, 68k, cfm68k). <p>
|
<p>
|
||||||
|
|
||||||
<em>Note:</em> always rebuild the CWGUSI libraries, even if you have
|
|
||||||
checked them out from the CVS repository. <P>
|
|
||||||
|
|
||||||
Next, in
|
Next, in
|
||||||
<code>MoreFiles</code>, <code>libjpeg</code>, <code>pbmplus</code>,
|
<code>libjpeg</code>, <code>pbmplus</code>,
|
||||||
<code>zlib</code>, <code>libpng</code>, <code>gdbm</code>,
|
<code>zlib</code>, <code>libpng</code>, <code>gdbm</code>,
|
||||||
and<code>libtiff</code> you build all projects. Usually the projects are in "mac"
|
and<code>libtiff</code> you build all projects. Usually the projects are in "mac"
|
||||||
subfolders, sometimes they are in the main folder. Tcl/tk is a special
|
subfolders, sometimes they are in the main folder. Tcl/tk is a special
|
||||||
case, see below. Of course, if you are only interested in one of
|
case, see below.
|
||||||
static 68K, CFM68K or PPC you can skip building the other libraries.
|
|
||||||
|
|
||||||
<H2><A NAME="tcltk">Building Tcl/Tk</H2>
|
<H2><A NAME="tcltk">Building Tcl/Tk</H2>
|
||||||
|
|
||||||
|
@ -222,14 +209,12 @@ folders:
|
||||||
<DL>
|
<DL>
|
||||||
<DT> Demo
|
<DT> Demo
|
||||||
<DD> Demo programs that are not Mac-specific. Some of these may not
|
<DD> Demo programs that are not Mac-specific. Some of these may not
|
||||||
work, the file <code>README-Mac</code> has some details.
|
work.
|
||||||
|
|
||||||
<DT> Extensions
|
<DT> Extensions
|
||||||
<DD> Extensions to the interpreter that are not Mac-specific. Contains
|
<DD> Extensions to the interpreter that are not Mac-specific. Contains
|
||||||
the <code>img</code>, <code>Imaging</code> and <code>Numeric</code> extensions
|
the <code>img</code>, <code>Imaging</code> and <code>Numerical</code> extensions
|
||||||
in this distribution. Nowadays, the extensions are all built in their own
|
in this distribution.
|
||||||
folders (unlike in older distributions, where img was incorporated in the main
|
|
||||||
build procedure).
|
|
||||||
|
|
||||||
<DT> Grammar
|
<DT> Grammar
|
||||||
<DD> The Python grammar. Included for reference only, you cannot build
|
<DD> The Python grammar. Included for reference only, you cannot build
|
||||||
|
@ -243,7 +228,7 @@ the parser on a Mac.
|
||||||
on the Mac.
|
on the Mac.
|
||||||
|
|
||||||
<DT> Objects
|
<DT> Objects
|
||||||
<DD> Machine-independent code for various objects. Most of these are
|
<DD> Machine-independent code for various object types. Most of these are
|
||||||
not really optional: the interpreter will not function without them.
|
not really optional: the interpreter will not function without them.
|
||||||
|
|
||||||
<DT> Parser
|
<DT> Parser
|
||||||
|
@ -254,11 +239,12 @@ not really optional: the interpreter will not function without them.
|
||||||
are unix-specific and not used on the Mac.
|
are unix-specific and not used on the Mac.
|
||||||
|
|
||||||
<DT> Tools
|
<DT> Tools
|
||||||
<DD> Tools for python developers. Contains <code>modulator</code>
|
<DD> Tools for python developers. Contains <code>modulator</code> which
|
||||||
which builds skeleton C extension modules and <code>bgen</code> which
|
builds skeleton C extension modules, <code>bgen</code> which generates
|
||||||
generates complete interface modules from information in C header
|
complete interface modules from information in C header files and
|
||||||
files. There are some readme files, but more documentation is sorely
|
<code>freeze</code> which is used to turn Python scripts into real
|
||||||
needed.
|
applications (used by MacFreeze and BuildApplication) There are some
|
||||||
|
readme files, but more documentation is sorely needed.
|
||||||
|
|
||||||
</DL>
|
</DL>
|
||||||
|
|
||||||
|
@ -271,8 +257,8 @@ resulting binaries, except for intermedeate results, are deposited in
|
||||||
the toplevel folder or the Mac:PlugIns folder (for plugin modules).
|
the toplevel folder or the Mac:PlugIns folder (for plugin modules).
|
||||||
|
|
||||||
<DT> Compat
|
<DT> Compat
|
||||||
<DD> Unix-compatability routines. Some of these are not used anymore,
|
<DD> Unix-compatability routines. Most of these are not used anymore,
|
||||||
since CWGUSI provides a rather complete emulation, but you may need
|
since GUSI provides a rather complete emulation, but you may need
|
||||||
these if you are trying to build a non-GUSI python.
|
these if you are trying to build a non-GUSI python.
|
||||||
|
|
||||||
<DT> Demo
|
<DT> Demo
|
||||||
|
@ -339,25 +325,14 @@ but for more control over the freezing process you can run the main script here.
|
||||||
|
|
||||||
<H2>Building the 68K interpreter</H2>
|
<H2>Building the 68K interpreter</H2>
|
||||||
|
|
||||||
If you have all the optional libraries mentioned <A
|
68K Python is no longer supported, and the projects are not included in the
|
||||||
HREF="#optional">above</A> loaded building Python for 68K macs is a
|
source distirbution anymore. If you really want to build Python for the 68K
|
||||||
breeze: in the Mac:Build folder you build the libraries with buildlibs.prj
|
your best bet is to check the sources out of the CVS repository. The latest
|
||||||
and then the interpreter with PythonStandalone.prj. <p>
|
projects (in :Mac:build:) that support 68K development are tagged as such,
|
||||||
|
and are dated around August 2000. If you plan on doing this announce it on
|
||||||
|
the SIG, please. <p>
|
||||||
|
|
||||||
If you were previously running another copy of this Python release,
|
<H2>Building the PPC interpreter</H2>
|
||||||
from a binary installer for instance, you should
|
|
||||||
first remove the <code>Python XXX preferences</code> file from your
|
|
||||||
preference folder. Next, run the interpreter, in the toplevel folder. This will
|
|
||||||
create a correct initial preferences file. You are now all set, and
|
|
||||||
your tree should be completely compatible with a binary-only
|
|
||||||
distribution. Read the release notes
|
|
||||||
(<code>Relnotes-somethingorother</code>) and
|
|
||||||
<code>ReadMe</code> in the <code>Mac</code> folder. <p>
|
|
||||||
|
|
||||||
If something goes wrong you may end up with a garbled preferences file. Removing
|
|
||||||
it from the system folder and running Python once again will re-create it.
|
|
||||||
|
|
||||||
<H2>Building the PPC and CFM68K interpreter</H2>
|
|
||||||
|
|
||||||
First you optionally build the external libraries with buildlibs.prj. Next,
|
First you optionally build the external libraries with buildlibs.prj. Next,
|
||||||
the projects for
|
the projects for
|
||||||
|
@ -371,14 +346,16 @@ For completeness sake here is a breakdown of the projects:
|
||||||
|
|
||||||
<DL>
|
<DL>
|
||||||
|
|
||||||
<DT> PythonCore (with subprojects PythonCorePPC and PythonCoreCFM68K)
|
<DT> PythonCore (with subproject PythonCorePPC)
|
||||||
<DD> The shared library that contains the bulk of the interpreter and
|
<DD> The shared library that contains the bulk of the interpreter and
|
||||||
its resources. It is a good idea to immedeately put an alias to this
|
its resources. It is a good idea to immedeately put an alias to this
|
||||||
shared library in the <code>Extensions</code> folder of your system
|
shared library in the <code>Extensions</code> folder of your system
|
||||||
folder. Do exactly that: put an <em>alias</em> there, copying or
|
folder. Do exactly that: put an <em>alias</em> there, copying or
|
||||||
moving the file will cause you grief later if you rebuild the library and
|
moving the file will cause you grief later if you rebuild the library and
|
||||||
forget to copy it to the extensions folder again. The InstallPython applet
|
forget to copy it to the extensions folder again. The InstallPython applet
|
||||||
will also do this, along with creating the plugin aliases.
|
will also do this, along with creating the plugin aliases. <br>
|
||||||
|
Note that the subproject looks a bit silly nowadays (with no more CFM68K
|
||||||
|
support) but you will have to live with that for this release.
|
||||||
|
|
||||||
<DT> PythonInterpeter
|
<DT> PythonInterpeter
|
||||||
<DD> The interpreter. This is basically a routine to call out to the
|
<DD> The interpreter. This is basically a routine to call out to the
|
||||||
|
@ -387,11 +364,12 @@ creating applets (for which formerly PythonApplet was used). <p>
|
||||||
|
|
||||||
<DT> Plugin projects
|
<DT> Plugin projects
|
||||||
<DD> Each plugin module has a separate project. The <code>Plugins.prj</code>
|
<DD> Each plugin module has a separate project. The <code>Plugins.prj</code>
|
||||||
project tries to build them all, but is known to be flakey under CW Pro 4.
|
project tries to build them all, but is known to be flakey. See <code>fullbuild</code>
|
||||||
|
below for a better way to build everything.
|
||||||
</DL>
|
</DL>
|
||||||
|
|
||||||
After creating the alias to <code>PythonCore</code> you remove any old
|
After creating the alias to <code>PythonCore</code> you remove any old
|
||||||
<code>Python XXX Preferences</code> file from the <code>Preferences</code> folder
|
<code>Python 2.0b1 Preferences</code> file from the <code>Preferences</code> folder
|
||||||
(if you had python installed on your system before) and run the interpreter once
|
(if you had python installed on your system before) and run the interpreter once
|
||||||
to create the correct preferences file. <p>
|
to create the correct preferences file. <p>
|
||||||
|
|
||||||
|
@ -409,10 +387,10 @@ easiest done with the <code>fullbuild</code> script from
|
||||||
Actually, the <code>fullbuild</code> script can be used to build
|
Actually, the <code>fullbuild</code> script can be used to build
|
||||||
everything, but you need a fully-functional interpreter before you can
|
everything, but you need a fully-functional interpreter before you can
|
||||||
use it (and one that isn't rebuilt in the process: you cannot rebuild
|
use it (and one that isn't rebuilt in the process: you cannot rebuild
|
||||||
a running program). You could copy the 68K interpreter to a different
|
a running program). You could copy the interpreter to a different
|
||||||
place and use that to run fullbuild, or use the standalone PPC python
|
place and use that to run fullbuild. The <code>PythonStandSmall.prj</code>
|
||||||
for this. I tend to keep a standalone interpreter in a safe place for
|
project builds an interpreter that is suited to this, and it can also come
|
||||||
this use only. <p>
|
in handy if you need to debug things (which is easier in a static program). <p>
|
||||||
|
|
||||||
</BLOCKQUOTE>
|
</BLOCKQUOTE>
|
||||||
|
|
||||||
|
@ -441,7 +419,7 @@ those routines have to be in the same code fragment as they are used from.
|
||||||
|
|
||||||
<H2><a name="cvs">Using the CVS source archive</a></H2>
|
<H2><a name="cvs">Using the CVS source archive</a></H2>
|
||||||
|
|
||||||
It is possible to access the Python sources through remote CVS. The
|
It is possible (and probably best) to access the Python sources through remote CVS. The
|
||||||
advantage of this is that you get the very latest sources, so any bug
|
advantage of this is that you get the very latest sources, so any bug
|
||||||
fixed or new features will be immedeately available. This is also the
|
fixed or new features will be immedeately available. This is also the
|
||||||
disadvantage, of course: as this is the same tree as is used for
|
disadvantage, of course: as this is the same tree as is used for
|
||||||
|
@ -461,7 +439,7 @@ filetypes, and this can seriously hinder you if, for instance, <code>.bmp</code>
|
||||||
is not a Windows bitmap file. <p>
|
is not a Windows bitmap file. <p>
|
||||||
|
|
||||||
The machine-independent Python sources are checked out from the main
|
The machine-independent Python sources are checked out from the main
|
||||||
Python CVS archive, see the <a
|
Python CVS archive on sourceforge.net, see the <a
|
||||||
href="http://www.python.org/download/cvs.html">Source access via
|
href="http://www.python.org/download/cvs.html">Source access via
|
||||||
CVS</a> page for details. When you check the sources out you will get
|
CVS</a> page for details. When you check the sources out you will get
|
||||||
something like <code>Python:dist:src</code>, and under that the
|
something like <code>Python:dist:src</code>, and under that the
|
||||||
|
@ -503,12 +481,11 @@ Some remarks that I could not fit in elsewhere:
|
||||||
<LI> It may be possible to use the <code>PythonCore</code> shared
|
<LI> It may be possible to use the <code>PythonCore</code> shared
|
||||||
library to embed Python in another program, if your program can live
|
library to embed Python in another program, if your program can live
|
||||||
with using GUSI for I/O. Use PythonCore in stead of your MSL C library
|
with using GUSI for I/O. Use PythonCore in stead of your MSL C library
|
||||||
(or, at the very least, link it before the normal C library). Let me
|
(or, at the very least, link it before the normal C library).
|
||||||
know whether this works.
|
|
||||||
|
|
||||||
<LI> It is possible to build PPC extension modules without building a
|
<LI> It is possible to build PPC extension modules without building a
|
||||||
complete Python. The binary distribution installer can optionally install
|
complete Python. The binary distribution installer can optionally install
|
||||||
all the needed folders. A template for a dynamic module can be found in
|
all the needed folders (the develop option). A template for a dynamic module can be found in
|
||||||
<code>xx.prj</code>.
|
<code>xx.prj</code>.
|
||||||
|
|
||||||
<LI> The Python shared library architecture is a variant of the architecture
|
<LI> The Python shared library architecture is a variant of the architecture
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
<H1>Embedding Python on the Mac</H1>
|
<H1>Embedding Python on the Mac</H1>
|
||||||
<HR>
|
<HR>
|
||||||
<B>Note</B>: if you have a binary-only release of MacPython you will not
|
<B>Note</B>: if you have a binary-only release of MacPython you will not
|
||||||
have this demo installed. Go to
|
have this demo installed. Install the developer option (in the standard installer) or go to
|
||||||
<a href="http://www.cwi.nl/~jack/macpython.html">Jack's MacPython Page</a>
|
<a href="http://www.cwi.nl/~jack/macpython.html">Jack's MacPython Page</a>
|
||||||
to download either a source or a development release if you want to embed
|
to download either a source release if you want to embed
|
||||||
Python in other applications. <p>
|
Python in other applications. <p>
|
||||||
|
|
||||||
Embedding Python on the mac is pretty similar to embedding it on other
|
Embedding Python on the mac is pretty similar to embedding it on other
|
||||||
|
|
|
@ -23,8 +23,7 @@ The easiest way to create an application from a Python script is simply by dropp
|
||||||
it on the <code>BuildApplication</code> applet in the main Python folder.
|
it on the <code>BuildApplication</code> applet in the main Python folder.
|
||||||
BuildApplication has a similar interface as BuildApplet: you drop a script on
|
BuildApplication has a similar interface as BuildApplet: you drop a script on
|
||||||
it and it will process it, along with an optional <code>.rsrc</code> file.
|
it and it will process it, along with an optional <code>.rsrc</code> file.
|
||||||
It does ask one extra question: whether you want to build your application for
|
<P>
|
||||||
PPC macs only, 68K macs or any Mac.<P>
|
|
||||||
|
|
||||||
What BuildApplication does, however, is very different. It parses your script,
|
What BuildApplication does, however, is very different. It parses your script,
|
||||||
recursively looking for all modules you use, bundles the compiled code for
|
recursively looking for all modules you use, bundles the compiled code for
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<HTML>
|
<HTML>
|
||||||
<HEAD>
|
<HEAD>
|
||||||
<TITLE>Using Python 1.5 on the Macintosh</TITLE>
|
<TITLE>Using Python 2.0 on the Macintosh</TITLE>
|
||||||
</HEAD>
|
</HEAD>
|
||||||
<BODY>
|
<BODY>
|
||||||
<H1>Using Python 1.5 on the Macintosh</H1>
|
<H1>Using Python 2.0 on the Macintosh</H1>
|
||||||
<HR>
|
<HR>
|
||||||
|
|
||||||
This document is an introduction to using Python on the Apple
|
This document is an introduction to using Python on the Apple
|
||||||
|
@ -15,26 +15,32 @@ tutorial, and provides some additional material. <p>
|
||||||
|
|
||||||
The tutorial, along with other indispensible documentation like the
|
The tutorial, along with other indispensible documentation like the
|
||||||
library reference and such, is also available in a number of different
|
library reference and such, is also available in a number of different
|
||||||
formats at <a href="ftp://ftp.python.org/pub/python/doc">
|
formats at <a href="http://www.python.org">
|
||||||
ftp://ftp.python.org/pub/python/doc</a>. The Adobe Acrobat <code>.pdf</code>
|
www.python.org</a>. The Adobe Acrobat <code>.pdf</code>
|
||||||
files are probably a good choice for reading or printing the documents
|
files are probably a good choice for reading or printing the documents
|
||||||
from your mac. <p>
|
from your mac. <p>
|
||||||
|
|
||||||
There is currently no good tutorial for the mac-specific features of
|
There is currently no good tutorial for the mac-specific features of
|
||||||
Python, but to whet your appetite: it has interfaces to many MacOS
|
Python, but to whet your appetite: it has interfaces to many MacOS
|
||||||
toolboxes (quickdraw, sound, quicktime, open scripting, etc) and
|
toolboxes (quickdraw, sound, quicktime, open scripting, etc) and
|
||||||
various portable toolboxes are available too (Tk, stdwin, complex
|
various portable toolboxes are available too (Tk, complex
|
||||||
numbers, image manipulation, etc). Some <A HREF="index.html">
|
numbers, image manipulation, etc). Some <A HREF="index.html">
|
||||||
annotated sample programs</A> are available to give you an idea of
|
annotated sample programs</A> are available to give you an idea of
|
||||||
Python's power. <P>
|
Python's power. <P>
|
||||||
|
|
||||||
<h2>Invoking the interpreter</h2>
|
<h2>Using Python</h2>
|
||||||
|
|
||||||
The name of the interpreter may differ on different installations: it
|
The best way to start using Python is by using the <code>Python IDE</code>,
|
||||||
may be called <CODE>PythonFAT</CODE> (for powerpc macs and 68K macs with
|
an integrated development environment with editor, debugger, class browser, etc.
|
||||||
CFM68K installed) or <CODE>Python68K</CODE> (for 68K macs).
|
Unfortunately the IDE is not yet documented here. Fortunately, however, it does not
|
||||||
It will always
|
need much documentation, so your best bet is to try it. <p>
|
||||||
be recognizable by the "16 ton" icon, though. You start the
|
|
||||||
|
<h2>Invoking the bare interpreter</h2>
|
||||||
|
|
||||||
|
An alternative method to use Python (and the method this document unfortunately emphasizes,
|
||||||
|
see the comment above) is to use the bare interpreter and an external text editor.
|
||||||
|
The name of the interpreter is <CODE>PythonInterpreter</CODE> and it is
|
||||||
|
recognizable by the "16 ton" icon. You start the
|
||||||
interpreter in interactive mode by double-clicking its icon: <p>
|
interpreter in interactive mode by double-clicking its icon: <p>
|
||||||
|
|
||||||
<img src="html.icons/python.gif"><p>
|
<img src="html.icons/python.gif"><p>
|
||||||
|
@ -417,7 +423,7 @@ The next section to check out is the <a href="index.html">annotated sample progr
|
||||||
|
|
||||||
<HR>
|
<HR>
|
||||||
<A HREF="http://www.cwi.nl/~jack">Jack Jansen</A>,
|
<A HREF="http://www.cwi.nl/~jack">Jack Jansen</A>,
|
||||||
<A HREF="mailto:jack@cwi.nl">jack@cwi.nl</A>, 27-Apr-98.
|
<A HREF="mailto:jack@cwi.nl">jack@cwi.nl</A>, 10-Sep-00.
|
||||||
|
|
||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
|
86
Mac/ReadMe
86
Mac/ReadMe
|
@ -1,4 +1,4 @@
|
||||||
How to install Python 1.6a2 on your Macintosh
|
How to install Python 2.0b1 on your Macintosh
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
|
|
||||||
If this is your first encounter with Python: you definitely need the
|
If this is your first encounter with Python: you definitely need the
|
||||||
|
@ -13,39 +13,29 @@ now. The documentation is in HTML format, start with index.html.
|
||||||
|
|
||||||
Caveats
|
Caveats
|
||||||
-------
|
-------
|
||||||
This is an alfa version, and for this once it really means that: there
|
This is a beta version, so use with caution.
|
||||||
are quite a few features that have only lightly been tested, and bugs are
|
|
||||||
to be expected.
|
|
||||||
|
|
||||||
Aside from the general Python 1.6 features like unicode support the
|
Aside from the general new Python 2.0 features (compared to 1.5.2, there
|
||||||
main new features of this MacPython release is support for multithreading.
|
was no 1.6 for the macintosh) like unicode support the main new features
|
||||||
This has had some preliminary testing, but please report any success or failure
|
of this MacPython release is support for multithreading. This has had
|
||||||
on the mailing list.
|
some preliminary testing, but please report any success or failure on
|
||||||
|
the mailing list.
|
||||||
|
|
||||||
This installer installs MacPython for PowerPC only, whether a 68K distribution
|
This installer installs MacPython for PowerPC only, if you really want
|
||||||
of Python 1.6 will happen is not certain at the moment.
|
68k support you will have to stay with 1.5.2. Or, if you are willing to
|
||||||
|
invest the time and have access to CodeWarrior you are welcome to try
|
||||||
Changes since 1.6a1
|
and build a 68k distribution, most of the projects and sources are
|
||||||
-------------------
|
reasonably up to date (May 2000). Contact me for details.
|
||||||
|
|
||||||
- All core-Python changes, plus a few from after 1.6a2, approximately as the
|
|
||||||
Python CVS tree was at May 5.
|
|
||||||
- The threading performance bug has been fixed.
|
|
||||||
- Tkinter is included again (yeah!), but only lightly tested. Please report
|
|
||||||
findings to the mailing list.
|
|
||||||
- macfsn.py is auto-imported on startup (unless disabled with a new option).
|
|
||||||
This retrofits macfs.StandardGetFile() and friends to use Navigation Services
|
|
||||||
in stead of the old Standard File dialogs.
|
|
||||||
- I think all installer problems have been fixed. Please report if not so.
|
|
||||||
|
|
||||||
What to install
|
What to install
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
This installer is PPC only: too many new MacOS features are not available on 68K,
|
This installer is PPC only: too many new MacOS features are not
|
||||||
and doing workarounds, even just #ifdeffing in the code, is too much work for
|
available on 68K, and doing workarounds, even just #ifdeffing in the
|
||||||
me right now. If someone wants to revive 68K-MacPython: please do so. The project
|
code, is too much work for me right now. If someone wants to revive
|
||||||
files still contain the 68K targets (they're simply skipped by the build process)
|
68K-MacPython: please do so. The project files still contain the 68K
|
||||||
so all that is needed is CodeWarrior, a source distribution and commitment.
|
targets (they're simply skipped by the build process) so all that is
|
||||||
|
needed is CodeWarrior, a source distribution and commitment.
|
||||||
|
|
||||||
The optional parts in this distribution are
|
The optional parts in this distribution are
|
||||||
- TK+PIL: Tkinter and support modules, plus Imaging, the Python image manipulation
|
- TK+PIL: Tkinter and support modules, plus Imaging, the Python image manipulation
|
||||||
|
@ -54,13 +44,16 @@ The optional parts in this distribution are
|
||||||
than imaging, but has only limited operations on images. There is a bridge
|
than imaging, but has only limited operations on images. There is a bridge
|
||||||
between the packages.
|
between the packages.
|
||||||
- Numeric: the LLNL Numeric Python extension. All sorts of nifty operations
|
- Numeric: the LLNL Numeric Python extension. All sorts of nifty operations
|
||||||
on matrices and such.
|
on matrices and such. This is the most recent version from the sourceforge archive.
|
||||||
- Developers kit: all header files and some tools and sample projects to get you started on
|
- Developers kit: all header files and some tools and sample projects to get you started on
|
||||||
writing Python extensions if you have CodeWarrior.
|
writing Python extensions if you have CodeWarrior.
|
||||||
All these except the DevKit are installed with Easy Install.
|
All these except the DevKit are installed with Easy Install.
|
||||||
|
|
||||||
After the installer finishes it automatically launches the
|
After the installer finishes it automatically launches the
|
||||||
ConfigurePython applet, to finish configuration of your Python.
|
ConfigurePython applet, to finish configuration of your Python.
|
||||||
|
If you have previously installed another copy of 2.0b1 you should manually
|
||||||
|
remove your preference file first (but no such action is needed for installing
|
||||||
|
beside older MacPythons, and they will live together happily).
|
||||||
|
|
||||||
If you don't have enough memory: the sizes choosen are somewhat
|
If you don't have enough memory: the sizes choosen are somewhat
|
||||||
arbitrary. Try lowering the application sizes in the finder "get info"
|
arbitrary. Try lowering the application sizes in the finder "get info"
|
||||||
|
@ -71,14 +64,10 @@ necessary to increase the application size.
|
||||||
After installing
|
After installing
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
The first step thing you could try is to run "compileall.py" to create
|
It is probably a good idea to run the automatic tests. Start
|
||||||
all .pyc files, but this isn't very important, as pyc files are
|
Python and "import test.autotest". This should print only 2 or 3 errors, about some
|
||||||
created on-the-fly as well. You may also want to skip this step if you
|
AM/PM format not supported in strftime, about a MemoryError in test_longexp and
|
||||||
are low on diskspace.
|
about a memory error in test_zlib.
|
||||||
|
|
||||||
Next, it is probably a good idea to run the automatic tests. Start
|
|
||||||
Python and "import test.autotest". This should not print only one error, about some
|
|
||||||
AM/PM format not supported in strftime.
|
|
||||||
It will, however, print some messages about optional features
|
It will, however, print some messages about optional features
|
||||||
not supported. Also, if you didn't run compileall before autotesting
|
not supported. Also, if you didn't run compileall before autotesting
|
||||||
you may run out of memory the first time you run the
|
you may run out of memory the first time you run the
|
||||||
|
@ -91,32 +80,39 @@ debugger and other goodies. The alternative is to use PythonInterpreter,
|
||||||
which is the lowlevel interpreter with a console-window only (similar to Unix
|
which is the lowlevel interpreter with a console-window only (similar to Unix
|
||||||
Python).
|
Python).
|
||||||
|
|
||||||
|
If your program uses Tkinter you MUST run it under PythonInterpreter, Tkinter
|
||||||
|
and IDE are incompatible and your program will fail in strange ways.
|
||||||
|
|
||||||
Uninstalling
|
Uninstalling
|
||||||
------------
|
------------
|
||||||
|
|
||||||
Two items are installed in the system folder: the interpreter shared
|
Two items are installed in the system folder: the interpreter shared
|
||||||
library "PythonCore 1.6a2" lives in the Extensions folder and the
|
library "PythonCore 2.0b1" lives in the Extensions folder and the
|
||||||
"Python 1.6a2 Preferences" file in the Preferences folder. All the rest
|
"Python 2.0b1 Preferences" file in the Python subfolder in the
|
||||||
of Python lives in the folder you installed in.
|
Preferences folder. All the rest of Python lives in the folder you
|
||||||
|
installed in.
|
||||||
|
|
||||||
Things to see
|
Things to see
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Start off at Mac:Demo:index.html. Read at least the first few sections.
|
Start off at Mac:Demo:index.html. Read at least the first few sections.
|
||||||
|
|
||||||
There are also some readme files in the "Read me files" folder that may
|
There are also some interesting files in the "Relnotes" folder that may
|
||||||
contain useful information. There is also a first stab at documentation
|
contain useful information. There is also a first stab at documentation
|
||||||
(plus examples) in the Mac:Demo folder. The toplevel Demo folder has
|
(plus examples) in the Mac:Demo folder. The toplevel Demo folder has
|
||||||
machine-independent demos.
|
machine-independent demos.
|
||||||
The Mac:Lib:test folder also has some programs that show simple
|
The Mac:Lib:test folder also has some programs that show simple
|
||||||
capabilities of various modules.
|
capabilities of various modules.
|
||||||
|
|
||||||
The "scripts" folder has some sample scripts. Some are useful, some are
|
The ":Mac:scripts" folder has some sample scripts. Some are useful, some are
|
||||||
just interesting to look at to see how various things work. The MkDistr,
|
just interesting to look at to see how various things work. The MkDistr,
|
||||||
mkapplet and fullbuild scripts (plus the ones mentioned above) may help
|
mkapplet and fullbuild scripts (plus the ones mentioned above) may help
|
||||||
you to understand how to use AppleEvents and various other toolboxes
|
you to understand how to use AppleEvents and various other toolboxes
|
||||||
from python.
|
from python.
|
||||||
|
|
||||||
|
Other mac-specific goodies can be found in :Mac:Tools, of which the IDE sources
|
||||||
|
and a CGI framework deserve special mention.
|
||||||
|
|
||||||
The 'img' group of modules, which handles I/O of many different image
|
The 'img' group of modules, which handles I/O of many different image
|
||||||
formats is included, but without documentation. You can find docs at
|
formats is included, but without documentation. You can find docs at
|
||||||
ftp://ftp.cwi.nl/pub/jack/python/img (or somewhere around there).
|
ftp://ftp.cwi.nl/pub/jack/python/img (or somewhere around there).
|
||||||
|
@ -133,7 +129,7 @@ that this means you can keep your older version around if you are unsure
|
||||||
whether to upgrade. The bad news is that your old preference settings
|
whether to upgrade. The bad news is that your old preference settings
|
||||||
are lost and you have to set them again.
|
are lost and you have to set them again.
|
||||||
|
|
||||||
After you are satisfied that 1.6a2 works as expected you can trash
|
After you are satisfied that 2.0b1 works as expected you can trash
|
||||||
anything in the system folder that has "python" in the name and not
|
anything in the system folder that has "python" in the name and not
|
||||||
"1.6a2".
|
"1.6a2".
|
||||||
|
|
||||||
|
@ -159,8 +155,8 @@ Thanks!
|
||||||
|
|
||||||
Thanks go to the whole Python community with Guido in the lead, of course.
|
Thanks go to the whole Python community with Guido in the lead, of course.
|
||||||
Mac-specific thanks go to the pythonmac-sig, Just van Rossum, Corran Webster,
|
Mac-specific thanks go to the pythonmac-sig, Just van Rossum, Corran Webster,
|
||||||
Erik van Blokland, Bill Bedford, Chris Stern, Gordon Worley, Oliver Steele, M. Papillon
|
Erik van Blokland, Bill Bedford, Chris Stern, Gordon Worley, Oliver Steele, M. Papillon,
|
||||||
and all the other people who provided feedback, code or both!
|
Steven Majewski and all the other people who provided feedback, code or both!
|
||||||
|
|
||||||
Feedback
|
Feedback
|
||||||
--------
|
--------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue