blob: 965412f79e148f535ea6720c254e13440a1857aa [file] [log] [blame]
Fred Drakeb51429a1998-04-17 02:46:34 +00001The modules in this manual are available on the Apple Macintosh only.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00002
Guido van Rossum66774a91996-07-21 02:20:58 +00003Aside from the modules described here there are also interfaces to
4various MacOS toolboxes, which are currently not extensively
5described. The toolboxes for which modules exist are:
Fred Drake55fca541998-02-18 15:21:26 +00006\module{AE} (Apple Events),
7\module{Cm} (Component Manager),
8\module{Ctl} (Control Manager),
9\module{Dlg} (Dialog Manager),
10\module{Evt} (Event Manager),
11\module{Fm} (Font Manager),
12\module{List} (List Manager),
13\module{Menu} (Moenu Manager),
14\module{Qd} (QuickDraw),
15\module{Qt} (QuickTime),
16\module{Res} (Resource Manager and Handles),
17\module{Scrap} (Scrap Manager),
18\module{Snd} (Sound Manager),
19\module{TE} (TextEdit),
20\module{Waste} (non-Apple \program{TextEdit} replacement) and
21\module{Win} (Window Manager).
Guido van Rossum66774a91996-07-21 02:20:58 +000022
23If applicable the module will define a number of Python objects for
24the various structures declared by the toolbox, and operations will be
25implemented as methods of the object. Other operations will be
26implemented as functions in the module. Not all operations possible in
Fred Drakeaf9b6e61998-02-19 19:45:19 +000027\C{} will also be possible in Python (callbacks are often a problem), and
Guido van Rossum66774a91996-07-21 02:20:58 +000028parameters will occasionally be different in Python (input and output
29buffers, especially). All methods and functions have a \code{__doc__}
30string describing their arguments and return values, and for
Fred Drakeaf9b6e61998-02-19 19:45:19 +000031additional description you are referred to \emph{Inside Macintosh} or
32similar works.
33
34The following modules are documented here:
35
Fred Drake1ee492e1998-02-21 06:30:17 +000036\begin{description}
Fred Drakeaf9b6e61998-02-19 19:45:19 +000037
38\item[mac]
39--- Similar interfaces to the \module{posix} module.
40
41\item[macpath]
42--- Path manipulation functions; use via \code{os.path}.
43
44\item[ctb]
45--- Interfaces to the Communications Tool Box. Only the Connection
46Manager is currently supported.
47
48\item[macconsole]
49--- Think C's console package is available using this module.
50
51\item[macdnr]
52--- Interfaces to the Macintosh Domain Name Resolver.
53
54\item[macfs]
55--- Support for FSSpec, the Alias Manager, \program{finder} aliases,
56and the Standard File package.
57
58\item[macic]
59--- Internet Config.
60
61\item[MacOS]
62--- Access to MacOS specific interpreter features.
63
64\item[macostools]
65--- Convenience routines for file manipulation.
66
67\item[findertools]
68--- Wrappers around the \program{finder}'s Apple Events interface.
69
70\item[mactcp]
71--- The MacTCP interfaces.
72
73\item[macspeech]
74--- Interface to the Macintosh Speech Manager.
75
76\item[EasyDialogs]
77--- Basic Macintosh dialogs.
78
79\item[FrameWork]
80--- Interactive application framework.
81
82\item[MiniAEFrame]
83--- Support to act as an Open Scripting Architecture (OSA) server
84(``Apple Events'').
85
Fred Drake1ee492e1998-02-21 06:30:17 +000086\end{description}
Fred Drakeaf9b6e61998-02-19 19:45:19 +000087
Guido van Rossum66774a91996-07-21 02:20:58 +000088
Fred Drake3a0351c1998-04-04 07:23:21 +000089\section{Built-in Module \module{mac}}
Fred Drake55fca541998-02-18 15:21:26 +000090\label{module-mac}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000091\bimodindex{mac}
Fred Drake55fca541998-02-18 15:21:26 +000092
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000093This module provides a subset of the operating system dependent
Fred Drake55fca541998-02-18 15:21:26 +000094functionality provided by the optional built-in module \module{posix}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000095It is best accessed through the more portable standard module
Fred Drake55fca541998-02-18 15:21:26 +000096\module{os}.
Fred Drake8a528bd1997-12-15 21:40:15 +000097\refbimodindex{posix}
98\refstmodindex{os}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000099
100The following functions are available in this module:
Fred Drake55fca541998-02-18 15:21:26 +0000101\function{chdir()},
102\function{close()},
103\function{dup()},
104\function{fdopen()},
105\function{getcwd()},
106\function{lseek()},
107\function{listdir()},
108\function{mkdir()},
109\function{open()},
110\function{read()},
111\function{rename()},
112\function{rmdir()},
113\function{stat()},
114\function{sync()},
115\function{unlink()},
116\function{write()},
117as well as the exception \exception{error}. Note that the times
118returned by \function{stat()} are floating-point values, like all time
119values in MacPython.
Guido van Rossum7e42cab1996-10-15 14:37:31 +0000120
Fred Drake55fca541998-02-18 15:21:26 +0000121One additional function is available: \function{xstat()}. This function
122returns the same information as \function{stat()}, but with three extra
Guido van Rossum7e42cab1996-10-15 14:37:31 +0000123values appended: the size of the resource fork of the file and its
Fred Drakeb51429a1998-04-17 02:46:34 +00001244-character creator and type.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000125
Fred Drake3a0351c1998-04-04 07:23:21 +0000126\section{Standard Module \module{macpath}}
Fred Drake55fca541998-02-18 15:21:26 +0000127\label{module-macpath}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000128\stmodindex{macpath}
Fred Drake55fca541998-02-18 15:21:26 +0000129
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000130This module provides a subset of the pathname manipulation functions
Fred Drake55fca541998-02-18 15:21:26 +0000131available from the optional standard module \module{posixpath}. It is
132best accessed through the more portable standard module \module{os}, as
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000133\code{os.path}.
Fred Drake8a528bd1997-12-15 21:40:15 +0000134\refstmodindex{posixpath}
135\refstmodindex{os}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000136
137The following functions are available in this module:
Fred Drake55fca541998-02-18 15:21:26 +0000138\function{normcase()},
139\function{normpath()},
140\function{isabs()},
141\function{join()},
142\function{split()},
143\function{isdir()},
144\function{isfile()},
145\function{walk()},
146\function{exists()}.
147For other functions available in \module{posixpath} dummy counterparts
Guido van Rossum66774a91996-07-21 02:20:58 +0000148are available.