annotate Doc/using/mac.rst @ 79691:05c8928362ee

Merge __next__ method link fixes with 3.3.
author Ezio Melotti <ezio.melotti@gmail.com>
date Fri, 12 Oct 2012 13:46:37 +0300
parents 8df619259056
children 0f0256e4a1ef
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43740
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
1
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
2 .. _using-on-mac:
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
3
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
4 ***************************
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
5 Using Python on a Macintosh
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
6 ***************************
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
7
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
8 :Author: Bob Savage <bobsavage@mac.com>
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
9
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
10
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
11 Python on a Macintosh running Mac OS X is in principle very similar to Python on
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
12 any other Unix platform, but there are a number of additional features such as
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
13 the IDE and the Package Manager that are worth pointing out.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
14
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
15 .. _getting-osx:
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
16
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
17 Getting and Installing MacPython
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
18 ================================
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
19
49137
17475eb55067 Merged revisions 66337,66347,66350,66352,66358 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 46970
diff changeset
20 Mac OS X 10.5 comes with Python 2.5.1 pre-installed by Apple. If you wish, you
17475eb55067 Merged revisions 66337,66347,66350,66352,66358 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 46970
diff changeset
21 are invited to install the most recent version of Python from the Python website
17475eb55067 Merged revisions 66337,66347,66350,66352,66358 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 46970
diff changeset
22 (http://www.python.org). A current "universal binary" build of Python, which
17475eb55067 Merged revisions 66337,66347,66350,66352,66358 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 46970
diff changeset
23 runs natively on the Mac's new Intel and legacy PPC CPU's, is available there.
43740
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
24
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
25 What you get after installing is a number of things:
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
26
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
27 * A :file:`MacPython 2.5` folder in your :file:`Applications` folder. In here
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
28 you find IDLE, the development environment that is a standard part of official
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
29 Python distributions; PythonLauncher, which handles double-clicking Python
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
30 scripts from the Finder; and the "Build Applet" tool, which allows you to
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
31 package Python scripts as standalone applications on your system.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
32
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
33 * A framework :file:`/Library/Frameworks/Python.framework`, which includes the
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
34 Python executable and libraries. The installer adds this location to your shell
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
35 path. To uninstall MacPython, you can simply remove these three things. A
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
36 symlink to the Python executable is placed in /usr/local/bin/.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
37
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
38 The Apple-provided build of Python is installed in
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
39 :file:`/System/Library/Frameworks/Python.framework` and :file:`/usr/bin/python`,
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
40 respectively. You should never modify or delete these, as they are
49137
17475eb55067 Merged revisions 66337,66347,66350,66352,66358 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 46970
diff changeset
41 Apple-controlled and are used by Apple- or third-party software. Remember that
17475eb55067 Merged revisions 66337,66347,66350,66352,66358 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 46970
diff changeset
42 if you choose to install a newer Python version from python.org, you will have
17475eb55067 Merged revisions 66337,66347,66350,66352,66358 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 46970
diff changeset
43 two different but functional Python installations on your computer, so it will
17475eb55067 Merged revisions 66337,66347,66350,66352,66358 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 46970
diff changeset
44 be important that your paths and usages are consistent with what you want to do.
43740
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
45
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
46 IDLE includes a help menu that allows you to access Python documentation. If you
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
47 are completely new to Python you should start reading the tutorial introduction
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
48 in that document.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
49
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
50 If you are familiar with Python on other Unix platforms you should read the
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
51 section on running Python scripts from the Unix shell.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
52
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
53
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
54 How to run a Python script
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
55 --------------------------
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
56
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
57 Your best way to get started with Python on Mac OS X is through the IDLE
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
58 integrated development environment, see section :ref:`ide` and use the Help menu
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
59 when the IDE is running.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
60
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
61 If you want to run Python scripts from the Terminal window command line or from
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
62 the Finder you first need an editor to create your script. Mac OS X comes with a
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
63 number of standard Unix command line editors, :program:`vim` and
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
64 :program:`emacs` among them. If you want a more Mac-like editor,
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
65 :program:`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
66 http://www.barebones.com/products/bbedit/index.shtml) are good choices, as is
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
67 :program:`TextMate` (see http://macromates.com/). Other editors include
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
68 :program:`Gvim` (http://macvim.org) and :program:`Aquamacs`
60359
9ec598b47da4 Merged revisions 79797 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 59609
diff changeset
69 (http://aquamacs.org/).
43740
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
70
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
71 To run your script from the Terminal window you must make sure that
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
72 :file:`/usr/local/bin` is in your shell search path.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
73
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
74 To run your script from the Finder you have two options:
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
75
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
76 * Drag it to :program:`PythonLauncher`
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
77
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
78 * Select :program:`PythonLauncher` as the default application to open your
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
79 script (or any .py script) through the finder Info window and double-click it.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
80 :program:`PythonLauncher` has various preferences to control how your script is
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
81 launched. Option-dragging allows you to change these for one invocation, or use
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
82 its Preferences menu to change things globally.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
83
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
84
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
85 .. _osx-gui-scripts:
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
86
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
87 Running scripts with a GUI
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
88 --------------------------
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
89
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
90 With older versions of Python, there is one Mac OS X quirk that you need to be
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
91 aware of: programs that talk to the Aqua window manager (in other words,
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
92 anything that has a GUI) need to be run in a special way. Use :program:`pythonw`
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
93 instead of :program:`python` to start such scripts.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
94
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
95 With Python 2.5, you can use either :program:`python` or :program:`pythonw`.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
96
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
97
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
98 Configuration
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
99 -------------
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
100
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
101 Python on OS X honors all standard Unix environment variables such as
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
102 :envvar:`PYTHONPATH`, but setting these variables for programs started from the
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
103 Finder is non-standard as the Finder does not read your :file:`.profile` or
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
104 :file:`.cshrc` at startup. You need to create a file :file:`~
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
105 /.MacOSX/environment.plist`. See Apple's Technical Document QA1067 for details.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
106
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
107 For more information on installation Python packages in MacPython, see section
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
108 :ref:`mac-package-manager`.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
109
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
110
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
111 .. _ide:
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
112
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
113 The IDE
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
114 =======
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
115
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
116 MacPython ships with the standard IDLE development environment. A good
62569
8df619259056 Merged revisions 80605-80609,80642-80646,80651-80652,80674,80684-80686,80748,80852,80854,80870,80872-80873,80907,80915-80916,80951-80952,80976-80977,80985,81038-81040,81042,81053,81070,81104-81105,81114,81125,81245,81285,81402,81463,81516,81562-81563,81567,81593,81635,81680-81681,81684,81801,81888,81931-81933,81939-81942,81963,81984,81991,82120,82188,82264-82267 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 60359
diff changeset
117 introduction to using IDLE can be found at
8df619259056 Merged revisions 80605-80609,80642-80646,80651-80652,80674,80684-80686,80748,80852,80854,80870,80872-80873,80907,80915-80916,80951-80952,80976-80977,80985,81038-81040,81042,81053,81070,81104-81105,81114,81125,81245,81285,81402,81463,81516,81562-81563,81567,81593,81635,81680-81681,81684,81801,81888,81931-81933,81939-81942,81963,81984,81991,82120,82188,82264-82267 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 60359
diff changeset
118 http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html.
43740
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
119
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
120
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
121 .. _mac-package-manager:
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
122
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
123 Installing Additional Python Packages
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
124 =====================================
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
125
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
126 There are several methods to install additional Python packages:
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
127
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
128 * http://pythonmac.org/packages/ contains selected compiled packages for Python
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
129 2.5, 2.4, and 2.3.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
130
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
131 * Packages can be installed via the standard Python distutils mode (``python
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
132 setup.py install``).
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
133
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
134 * Many packages can also be installed via the :program:`setuptools` extension.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
135
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
136
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
137 GUI Programming on the Mac
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
138 ==========================
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
139
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
140 There are several options for building GUI applications on the Mac with Python.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
141
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
142 *PyObjC* is a Python binding to Apple's Objective-C/Cocoa framework, which is
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
143 the foundation of most modern Mac development. Information on PyObjC is
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
144 available from http://pyobjc.sourceforge.net.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
145
59609
df8f81df8595 #7057: fix several errors.
Ezio Melotti <ezio.melotti@gmail.com>
parents: 55955
diff changeset
146 The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-platform
43740
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
147 Tk toolkit (http://www.tcl.tk). An Aqua-native version of Tk is bundled with OS
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
148 X by Apple, and the latest version can be downloaded and installed from
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
149 http://www.activestate.com; it can also be built from source.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
150
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
151 *wxPython* is another popular cross-platform GUI toolkit that runs natively on
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
152 Mac OS X. Packages and documentation are available from http://www.wxpython.org.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
153
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
154 *PyQt* is another popular cross-platform GUI toolkit that runs natively on Mac
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
155 OS X. More information can be found at
55955
9b2a42fbd04b Merged revisions 74788 via svnmerge from
Ezio Melotti <ezio.melotti@gmail.com>
parents: 49137
diff changeset
156 http://www.riverbankcomputing.co.uk/software/pyqt/intro.
43740
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
157
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
158
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
159 Distributing Python Applications on the Mac
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
160 ===========================================
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
161
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
162 The "Build Applet" tool that is placed in the MacPython 2.5 folder is fine for
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
163 packaging small Python scripts on your own machine to run as a standard Mac
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
164 application. This tool, however, is not robust enough to distribute Python
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
165 applications to other users.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
166
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
167 The standard tool for deploying standalone Python applications on the Mac is
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
168 :program:`py2app`. More information on installing and using py2app can be found
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
169 at http://undefined.org/python/#py2app.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
170
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
171
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
172 Application Scripting
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
173 =====================
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
174
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
175 Python can also be used to script other Mac applications via Apple's Open
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
176 Scripting Architecture (OSA); see http://appscript.sourceforge.net. Appscript is
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
177 a high-level, user-friendly Apple event bridge that allows you to control
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
178 scriptable Mac OS X applications using ordinary Python scripts. Appscript makes
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
179 Python a serious alternative to Apple's own *AppleScript* language for
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
180 automating your Mac. A related package, *PyOSA*, is an OSA language component
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
181 for the Python scripting language, allowing Python code to be executed by any
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
182 OSA-enabled application (Script Editor, Mail, iTunes, etc.). PyOSA makes Python
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
183 a full peer to AppleScript.
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
184
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
185
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
186 Other Resources
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
187 ===============
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
188
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
189 The MacPython mailing list is an excellent support resource for Python users and
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
190 developers on the Mac:
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
191
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
192 http://www.python.org/community/sigs/current/pythonmac-sig/
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
193
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
194 Another useful resource is the MacPython wiki:
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
195
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
196 http://wiki.python.org/moin/MacPython
c00dc7586714 Add new directory "using". This should have been in the merge patch,
Georg Brandl <georg@python.org>
parents:
diff changeset
197