Built-in Module MacOS

MacOS

This module provides access to MacOS specific functionality in the python interpreter, such as how the interpreter eventloop functions and the like. Use with care.

Note the capitalisation of the module name, this is a historical artefact.


\begin{excdesc}{Error}
This exception is raised on MacOS generated errors, eithe...
...wn error codes are defined in the standard
module \var{macerrors}.
\end{excdesc}


\begin{funcdesc}{SetHighLevelEventHandler}{handler}
Pass a python function that ...
...nly called dependably if
your main event loop is in \var{stdwin}.
\end{funcdesc}


\begin{funcdesc}{AcceptHighLevelEvent}{}
Read a high-level event. The return value is a tuple \code{(sender,
refcon, data)}.
\end{funcdesc}


\begin{funcdesc}{SetScheduleTimes}{fgi\, fgy \optional{\, bgi\, bgy}}
Controls h...
...ed on minimal empirical testing, are 12, 1, 6
and 2 respectively.
\end{funcdesc}


\begin{funcdesc}{EnableAppswitch}{onoff}
Enable or disable the python event loop...
...ent queue. Making sure nothing is ever printed works around
this.
\end{funcdesc}


\begin{funcdesc}{HandleEvent}{ev}
Pass the event record \code{ev} back to the py...
...o still have some command-period and
window-switching capability.
\end{funcdesc}


\begin{funcdesc}{GetErrorString}{errno}
Return the textual description of MacOS error code \var{errno}.
\end{funcdesc}


\begin{funcdesc}{splash}{resid}
This function will put a splash window
on-screen...
...lization without first having to load numerous
extension modules.
\end{funcdesc}


\begin{funcdesc}{DebugStr}{message \optional{\, object}}
Drop to the low-level d...
...It is intended mainly for developers of Python extension
modules.
\end{funcdesc}


\begin{funcdesc}{openrf}{name \optional{\, mode}}
Open the resource fork of a fi...
... is not a python file object, so there may be subtle
differences.
\end{funcdesc}