Availability: Macintosh.
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 capitalization of the module name; this is a historical artifact.
'carbon'
or 'macho'
. This
signifies whether this Python uses the Mac OS X and Mac OS 9 compatible
CarbonLib style or the Mac OS
X-only Mach-O style. In earlier versions of Python the value could
also be 'ppc'
for the classic Mac OS 8 runtime model.
'static'
for a
statically linked Python, 'framework'
for Python in a Mac OS X framework,
'shared'
for Python in a standard unix shared library and
'cfm'
for the Mac OS 9-compatible Python.
handler) |
Call SetEventHandler() without a parameter to clear the event handler. Setting an event handler while one is already set is an error.
Availability: MacPython-OS9.
[doint[, evtmask[, besocial[, interval[, bgyield]]]]]) |
All parameters are optional, and default to the current value. The return value of this function is a tuple with the old values of these options. Initial defaults are that all processing is enabled, checking is done every quarter second and the processor is given up for a quarter second when in the background.
The most common use case is to call SchedParams(0, 0)
to completely disable
event handling in the interpreter mainloop.
Availability: MacPython-OS9.
ev) |
sys.stdout
window (based on the
compiler used to build Python). This allows Python programs that do
their own event handling to still have some command-period and
window-switching capability.
If you attempt to call this function from an event handler set through SetEventHandler() you will get an exception.
Availability: MacPython-OS9.
errno) |
resid) |
Availability: MacPython-OS9.
message [, object]) |
Note that you should use this function with extreme care: if no low-level debugger like MacsBug is installed this call will crash your system. It is intended mainly for developers of Python extension modules.
) |
) |
file) |
FSSpec
or
FSRef
object.
file, creator, type) |
FSSpec
or
FSRef
object. creator and type must be four character
strings.
name [, mode]) |
) |
False
if the window manager is not available,
for instance when running on Mac OS X Server or when logged in via ssh,
or when the current interpreter is not running from a fullblown application
bundle. A script runs from an application bundle either when it has been
started with pythonw instead of python or when running
as an applet.
On Mac OS 9 the method always returns True
.