Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8f1462e52e1797a02c97073eed0b7f92 > files > 794

python-docs-2.6.5-2.5mdv2010.2.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>37.2. MacOS — Access to Mac OS interpreter features &mdash; Python v2.6.5 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.6.5',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python v2.6.5 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="top" title="Python v2.6.5 documentation" href="../index.html" />
    <link rel="up" title="37. Mac OS X specific services" href="mac.html" />
    <link rel="next" title="37.3. macostools — Convenience routines for file manipulation" href="macostools.html" />
    <link rel="prev" title="37.1. ic — Access to the Mac OS X Internet Config" href="ic.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 

  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             accesskey="M">modules</a> |</li>
        <li class="right" >
          <a href="macostools.html" title="37.3. macostools — Convenience routines for file manipulation"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="ic.html" title="37.1. ic — Access to the Mac OS X Internet Config"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">Python v2.6.5 documentation</a> &raquo;</li>

          <li><a href="index.html" >The Python Standard Library</a> &raquo;</li>
          <li><a href="mac.html" accesskey="U">37. Mac OS X specific services</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-MacOS">
<h1>37.2. <tt class="xref docutils literal"><span class="pre">MacOS</span></tt> &#8212; Access to Mac OS interpreter features<a class="headerlink" href="#module-MacOS" title="Permalink to this headline">¶</a></h1>
<p><em>Platforms: </em>Mac</p>
<p>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.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This module has been removed in Python 3.x.</p>
</div>
<p>Note the capitalization of the module name; this is a historical artifact.</p>
<dl class="data">
<dt id="MacOS.runtimemodel">
<tt class="descclassname">MacOS.</tt><tt class="descname">runtimemodel</tt><a class="headerlink" href="#MacOS.runtimemodel" title="Permalink to this definition">¶</a></dt>
<dd>Always <tt class="docutils literal"><span class="pre">'macho'</span></tt>, from Python 2.4 on. In earlier versions of Python the value
could also be <tt class="docutils literal"><span class="pre">'ppc'</span></tt> for the classic Mac OS 8 runtime model or <tt class="docutils literal"><span class="pre">'carbon'</span></tt>
for the Mac OS 9 runtime model.</dd></dl>

<dl class="data">
<dt id="MacOS.linkmodel">
<tt class="descclassname">MacOS.</tt><tt class="descname">linkmodel</tt><a class="headerlink" href="#MacOS.linkmodel" title="Permalink to this definition">¶</a></dt>
<dd>The way the interpreter has been linked. As extension modules may be
incompatible between linking models, packages could use this information to give
more decent error messages. The value is one of <tt class="docutils literal"><span class="pre">'static'</span></tt> for a statically
linked Python, <tt class="docutils literal"><span class="pre">'framework'</span></tt> for Python in a Mac OS X framework, <tt class="docutils literal"><span class="pre">'shared'</span></tt>
for Python in a standard Unix shared library. Older Pythons could also have the
value <tt class="docutils literal"><span class="pre">'cfm'</span></tt> for Mac OS 9-compatible Python.</dd></dl>

<dl class="exception">
<dt id="MacOS.Error">
<em class="property">exception </em><tt class="descclassname">MacOS.</tt><tt class="descname">Error</tt><a class="headerlink" href="#MacOS.Error" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-423">This exception is raised on MacOS generated errors, either from functions in
this module or from other mac-specific modules like the toolbox interfaces. The
arguments are the integer error code (the <tt class="xref docutils literal"><span class="pre">OSErr</span></tt> value) and a textual
description of the error code. Symbolic names for all known error codes are
defined in the standard module <a title="(Mac) Constant definitions for many Mac OS error codes. (deprecated)" class="reference external" href="undoc.html#module-macerrors"><tt class="xref docutils literal"><span class="pre">macerrors</span></tt></a>.</p>
</dd></dl>

<dl class="function">
<dt id="MacOS.GetErrorString">
<tt class="descclassname">MacOS.</tt><tt class="descname">GetErrorString</tt><big>(</big><em>errno</em><big>)</big><a class="headerlink" href="#MacOS.GetErrorString" title="Permalink to this definition">¶</a></dt>
<dd>Return the textual description of MacOS error code <em>errno</em>.</dd></dl>

<dl class="function">
<dt id="MacOS.DebugStr">
<tt class="descclassname">MacOS.</tt><tt class="descname">DebugStr</tt><big>(</big><em>message</em><span class="optional">[</span>, <em>object</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#MacOS.DebugStr" title="Permalink to this definition">¶</a></dt>
<dd><p>On Mac OS X the string is simply printed to stderr (on older Mac OS systems more
elaborate functionality was available), but it provides a convenient location to
attach a breakpoint in a low-level debugger like <strong>gdb</strong>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Not available in 64-bit mode.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="MacOS.SysBeep">
<tt class="descclassname">MacOS.</tt><tt class="descname">SysBeep</tt><big>(</big><big>)</big><a class="headerlink" href="#MacOS.SysBeep" title="Permalink to this definition">¶</a></dt>
<dd><p>Ring the bell.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Not available in 64-bit mode.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="MacOS.GetTicks">
<tt class="descclassname">MacOS.</tt><tt class="descname">GetTicks</tt><big>(</big><big>)</big><a class="headerlink" href="#MacOS.GetTicks" title="Permalink to this definition">¶</a></dt>
<dd>Get the number of clock ticks (1/60th of a second) since system boot.</dd></dl>

<dl class="function">
<dt id="MacOS.GetCreatorAndType">
<tt class="descclassname">MacOS.</tt><tt class="descname">GetCreatorAndType</tt><big>(</big><em>file</em><big>)</big><a class="headerlink" href="#MacOS.GetCreatorAndType" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the file creator and file type as two four-character strings. The <em>file</em>
parameter can be a pathname or an <tt class="docutils literal"><span class="pre">FSSpec</span></tt> or  <tt class="docutils literal"><span class="pre">FSRef</span></tt> object.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">It is not possible to use an <tt class="docutils literal"><span class="pre">FSSpec</span></tt> in 64-bit mode.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="MacOS.SetCreatorAndType">
<tt class="descclassname">MacOS.</tt><tt class="descname">SetCreatorAndType</tt><big>(</big><em>file</em>, <em>creator</em>, <em>type</em><big>)</big><a class="headerlink" href="#MacOS.SetCreatorAndType" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the file creator and file type. The <em>file</em> parameter can be a pathname or an
<tt class="docutils literal"><span class="pre">FSSpec</span></tt> or  <tt class="docutils literal"><span class="pre">FSRef</span></tt> object. <em>creator</em> and <em>type</em> must be four character
strings.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">It is not possible to use an <tt class="docutils literal"><span class="pre">FSSpec</span></tt> in 64-bit mode.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="MacOS.openrf">
<tt class="descclassname">MacOS.</tt><tt class="descname">openrf</tt><big>(</big><em>name</em><span class="optional">[</span>, <em>mode</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#MacOS.openrf" title="Permalink to this definition">¶</a></dt>
<dd>Open the resource fork of a file. Arguments are the same as for the built-in
function <a title="open" class="reference external" href="functions.html#open"><tt class="xref docutils literal"><span class="pre">open()</span></tt></a>. The object returned has file-like semantics, but it is
not a Python file object, so there may be subtle differences.</dd></dl>

<dl class="function">
<dt id="MacOS.WMAvailable">
<tt class="descclassname">MacOS.</tt><tt class="descname">WMAvailable</tt><big>(</big><big>)</big><a class="headerlink" href="#MacOS.WMAvailable" title="Permalink to this definition">¶</a></dt>
<dd>Checks whether the current process has access to the window manager. The method
will return <tt class="xref docutils literal"><span class="pre">False</span></tt> 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
<strong>pythonw</strong> instead of <strong>python</strong> or when running  as an applet.</dd></dl>

<dl class="function">
<dt id="MacOS.splash">
<tt class="descclassname">MacOS.</tt><tt class="descname">splash</tt><big>(</big><span class="optional">[</span><em>resourceid</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#MacOS.splash" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens a splash screen by resource id. Use resourceid <tt class="docutils literal"><span class="pre">0</span></tt> to close
the splash screen.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Not available in 64-bit mode.</p>
</div>
</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h4>Previous topic</h4>
            <p class="topless"><a href="ic.html"
                                  title="previous chapter">37.1. <tt class="docutils literal docutils literal docutils literal"><span class="pre">ic</span></tt> &#8212; Access to the Mac OS X Internet Config</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="macostools.html"
                                  title="next chapter">37.3. <tt class="docutils literal docutils literal"><span class="pre">macostools</span></tt> &#8212; Convenience routines for file manipulation</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/library/macos.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="macostools.html" title="37.3. macostools — Convenience routines for file manipulation"
             >next</a> |</li>
        <li class="right" >
          <a href="ic.html" title="37.1. ic — Access to the Mac OS X Internet Config"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">Python v2.6.5 documentation</a> &raquo;</li>

          <li><a href="index.html" >The Python Standard Library</a> &raquo;</li>
          <li><a href="mac.html" >37. Mac OS X specific services</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2010, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.  
    <a href="http://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Mar 19, 2010.
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.5.
    </div>

  </body>
</html>