Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > e1011ddec34cda34f3a002b121247943 > files > 829

python-docs-2.7.17-1.1.mga7.noarch.rpm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>37.2. MacOS — Access to Mac OS interpreter features &#8212; Python 2.7.17 documentation</title>
    <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../_static/sidebar.js"></script>
    
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python 2.7.17 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="copyright" title="Copyright" href="../copyright.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" />
    <link rel="canonical" href="https://docs.python.org/2/library/macos.html" />
    <script type="text/javascript" src="../_static/copybutton.js"></script>
    
 
    

  </head><body>  
    <div class="related" role="navigation" aria-label="related navigation">
      <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="../py-modindex.html" title="Python Module Index"
             >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="https://www.python.org/">Python</a> &#187;</li>
        <li>
          <a href="../index.html">Python 2.7.17 documentation</a> &#187;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="mac.html" accesskey="U">37. Mac OS X specific services</a> &#187;</li> 
      </ul>
    </div>    

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="module-MacOS">
<span id="macos-access-to-mac-os-interpreter-features"></span><h1>37.2. <a class="reference internal" href="#module-MacOS" title="MacOS: Access to Mac OS-specific interpreter features. (deprecated) (Mac)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">MacOS</span></code></a> — Access to Mac OS interpreter features<a class="headerlink" href="#module-MacOS" title="Permalink to this headline">¶</a></h1>
<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="admonition-title">Note</p>
<p>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">
<code class="descclassname">MacOS.</code><code class="descname">runtimemodel</code><a class="headerlink" href="#MacOS.runtimemodel" title="Permalink to this definition">¶</a></dt>
<dd><p>Always <code class="docutils literal notranslate"><span class="pre">'macho'</span></code>, from Python 2.4 on. In earlier versions of Python the value
could also be <code class="docutils literal notranslate"><span class="pre">'ppc'</span></code> for the classic Mac OS 8 runtime model or <code class="docutils literal notranslate"><span class="pre">'carbon'</span></code>
for the Mac OS 9 runtime model.</p>
</dd></dl>

<dl class="data">
<dt id="MacOS.linkmodel">
<code class="descclassname">MacOS.</code><code class="descname">linkmodel</code><a class="headerlink" href="#MacOS.linkmodel" title="Permalink to this definition">¶</a></dt>
<dd><p>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 <code class="docutils literal notranslate"><span class="pre">'static'</span></code> for a statically
linked Python, <code class="docutils literal notranslate"><span class="pre">'framework'</span></code> for Python in a Mac OS X framework, <code class="docutils literal notranslate"><span class="pre">'shared'</span></code>
for Python in a standard Unix shared library. Older Pythons could also have the
value <code class="docutils literal notranslate"><span class="pre">'cfm'</span></code> for Mac OS 9-compatible Python.</p>
</dd></dl>

<dl class="exception">
<dt id="MacOS.Error">
<em class="property">exception </em><code class="descclassname">MacOS.</code><code class="descname">Error</code><a class="headerlink" href="#MacOS.Error" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-0">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 <code class="xref c c-data docutils literal notranslate"><span class="pre">OSErr</span></code> value) and a textual
description of the error code. Symbolic names for all known error codes are
defined in the standard module <a class="reference internal" href="undoc.html#module-macerrors" title="macerrors: Constant definitions for many Mac OS error codes. (deprecated) (Mac)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">macerrors</span></code></a>.</p>
</dd></dl>

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

<dl class="function">
<dt id="MacOS.DebugStr">
<code class="descclassname">MacOS.</code><code class="descname">DebugStr</code><span class="sig-paren">(</span><em>message</em><span class="optional">[</span>, <em>object</em><span class="optional">]</span><span class="sig-paren">)</span><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 class="program">gdb</strong>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Not available in 64-bit mode.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="MacOS.SysBeep">
<code class="descclassname">MacOS.</code><code class="descname">SysBeep</code><span class="sig-paren">(</span><span class="sig-paren">)</span><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="admonition-title">Note</p>
<p>Not available in 64-bit mode.</p>
</div>
</dd></dl>

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

<dl class="function">
<dt id="MacOS.GetCreatorAndType">
<code class="descclassname">MacOS.</code><code class="descname">GetCreatorAndType</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><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 <code class="docutils literal notranslate"><span class="pre">FSSpec</span></code> or  <code class="docutils literal notranslate"><span class="pre">FSRef</span></code> object.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>It is not possible to use an <code class="docutils literal notranslate"><span class="pre">FSSpec</span></code> in 64-bit mode.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="MacOS.SetCreatorAndType">
<code class="descclassname">MacOS.</code><code class="descname">SetCreatorAndType</code><span class="sig-paren">(</span><em>file</em>, <em>creator</em>, <em>type</em><span class="sig-paren">)</span><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
<code class="docutils literal notranslate"><span class="pre">FSSpec</span></code> or  <code class="docutils literal notranslate"><span class="pre">FSRef</span></code> object. <em>creator</em> and <em>type</em> must be four character
strings.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>It is not possible to use an <code class="docutils literal notranslate"><span class="pre">FSSpec</span></code> in 64-bit mode.</p>
</div>
</dd></dl>

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

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

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

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="ic.html"
                        title="previous chapter">37.1. <code class="xref py py-mod docutils literal notranslate"><span class="pre">ic</span></code> — 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. <code class="xref py py-mod docutils literal notranslate"><span class="pre">macostools</span></code> — Convenience routines for file manipulation</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/library/macos.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>  
    <div class="related" role="navigation" aria-label="related navigation">
      <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="../py-modindex.html" title="Python 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="https://www.python.org/">Python</a> &#187;</li>
        <li>
          <a href="../index.html">Python 2.7.17 documentation</a> &#187;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="mac.html" >37. Mac OS X specific services</a> &#187;</li> 
      </ul>
    </div>  
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2019, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Oct 19, 2019.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.0.1.
    </div>

  </body>
</html>