Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > a600cd26dfe6bfd8c11f12bce5cb0eee > files > 575

python3-docs-3.5.3-1.1.mga6.noarch.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>The Very High Level Layer &mdash; Python 3.5.3 documentation</title>
    
    <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '3.5.3',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </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/sidebar.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python 3.5.3 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 3.5.3 documentation" href="../contents.html" />
    <link rel="up" title="Python/C API Reference Manual" href="index.html" />
    <link rel="next" title="Reference Counting" href="refcounting.html" />
    <link rel="prev" title="Stable Application Binary Interface" href="stable.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
    
    <script type="text/javascript" src="../_static/copybutton.js"></script>
    <script type="text/javascript" src="../_static/version_switch.js"></script>
    
    
 

  </head>
  <body role="document">  
    <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="refcounting.html" title="Reference Counting"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="stable.html" title="Stable Application Binary Interface"
             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> &raquo;</li>
        <li>
          <span class="version_switcher_placeholder">3.5.3</span>
          <a href="../index.html">Documentation </a> &raquo;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Python/C API Reference Manual</a> &raquo;</li>
    <li class="right">
        

    <div class="inline-search" style="display: none" role="search">
        <form class="inline-search" action="../search.html" method="get">
          <input placeholder="Quick search" type="text" name="q" />
          <input type="submit" value="Go" />
          <input type="hidden" name="check_keywords" value="yes" />
          <input type="hidden" name="area" value="default" />
        </form>
    </div>
    <script type="text/javascript">$('.inline-search').show(0);</script>
         |
    </li>

      </ul>
    </div>    

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="the-very-high-level-layer">
<span id="veryhigh"></span><h1>The Very High Level Layer<a class="headerlink" href="#the-very-high-level-layer" title="Permalink to this headline">¶</a></h1>
<p>The functions in this chapter will let you execute Python source code given in a
file or a buffer, but they will not let you interact in a more detailed way with
the interpreter.</p>
<p>Several of these functions accept a start symbol from the grammar as a
parameter.  The available start symbols are <code class="xref py py-const docutils literal"><span class="pre">Py_eval_input</span></code>,
<code class="xref py py-const docutils literal"><span class="pre">Py_file_input</span></code>, and <code class="xref py py-const docutils literal"><span class="pre">Py_single_input</span></code>.  These are described
following the functions which accept them as parameters.</p>
<p>Note also that several of these functions take <code class="xref c c-type docutils literal"><span class="pre">FILE*</span></code> parameters.  One
particular issue which needs to be handled carefully is that the <code class="xref c c-type docutils literal"><span class="pre">FILE</span></code>
structure for different C libraries can be different and incompatible.  Under
Windows (at least), it is possible for dynamically linked extensions to actually
use different libraries, so care should be taken that <code class="xref c c-type docutils literal"><span class="pre">FILE*</span></code> parameters
are only passed to these functions if it is certain that they were created by
the same library that the Python runtime is using.</p>
<dl class="function">
<dt id="c.Py_Main">
int <code class="descname">Py_Main</code><span class="sig-paren">(</span>int<em>&nbsp;argc</em>, wchar_t<em>&nbsp;**argv</em><span class="sig-paren">)</span><a class="headerlink" href="#c.Py_Main" title="Permalink to this definition">¶</a></dt>
<dd><p>The main program for the standard interpreter.  This is made available for
programs which embed Python.  The <em>argc</em> and <em>argv</em> parameters should be
prepared exactly as those which are passed to a C program&#8217;s <code class="xref c c-func docutils literal"><span class="pre">main()</span></code>
function (converted to wchar_t according to the user&#8217;s locale).  It is
important to note that the argument list may be modified (but the contents of
the strings pointed to by the argument list are not). The return value will
be <code class="docutils literal"><span class="pre">0</span></code> if the interpreter exits normally (i.e., without an exception),
<code class="docutils literal"><span class="pre">1</span></code> if the interpreter exits due to an exception, or <code class="docutils literal"><span class="pre">2</span></code> if the parameter
list does not represent a valid Python command line.</p>
<p>Note that if an otherwise unhandled <a class="reference internal" href="../library/exceptions.html#SystemExit" title="SystemExit"><code class="xref py py-exc docutils literal"><span class="pre">SystemExit</span></code></a> is raised, this
function will not return <code class="docutils literal"><span class="pre">1</span></code>, but exit the process, as long as
<code class="docutils literal"><span class="pre">Py_InspectFlag</span></code> is not set.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_AnyFile">
int <code class="descname">PyRun_AnyFile</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_AnyFile" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_AnyFileExFlags" title="PyRun_AnyFileExFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_AnyFileExFlags()</span></code></a> below, leaving
<em>closeit</em> set to <code class="docutils literal"><span class="pre">0</span></code> and <em>flags</em> set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_AnyFileFlags">
int <code class="descname">PyRun_AnyFileFlags</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_AnyFileFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_AnyFileExFlags" title="PyRun_AnyFileExFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_AnyFileExFlags()</span></code></a> below, leaving
the <em>closeit</em> argument set to <code class="docutils literal"><span class="pre">0</span></code>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_AnyFileEx">
int <code class="descname">PyRun_AnyFileEx</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;closeit</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_AnyFileEx" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_AnyFileExFlags" title="PyRun_AnyFileExFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_AnyFileExFlags()</span></code></a> below, leaving
the <em>flags</em> argument set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_AnyFileExFlags">
int <code class="descname">PyRun_AnyFileExFlags</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;closeit</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_AnyFileExFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>If <em>fp</em> refers to a file associated with an interactive device (console or
terminal input or Unix pseudo-terminal), return the value of
<a class="reference internal" href="#c.PyRun_InteractiveLoop" title="PyRun_InteractiveLoop"><code class="xref c c-func docutils literal"><span class="pre">PyRun_InteractiveLoop()</span></code></a>, otherwise return the result of
<a class="reference internal" href="#c.PyRun_SimpleFile" title="PyRun_SimpleFile"><code class="xref c c-func docutils literal"><span class="pre">PyRun_SimpleFile()</span></code></a>.  <em>filename</em> is decoded from the filesystem
encoding (<a class="reference internal" href="../library/sys.html#sys.getfilesystemencoding" title="sys.getfilesystemencoding"><code class="xref py py-func docutils literal"><span class="pre">sys.getfilesystemencoding()</span></code></a>).  If <em>filename</em> is <em>NULL</em>, this
function uses <code class="docutils literal"><span class="pre">&quot;???&quot;</span></code> as the filename.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_SimpleString">
int <code class="descname">PyRun_SimpleString</code><span class="sig-paren">(</span>const char<em>&nbsp;*command</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_SimpleString" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_SimpleStringFlags" title="PyRun_SimpleStringFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_SimpleStringFlags()</span></code></a> below,
leaving the <em>PyCompilerFlags*</em> argument set to NULL.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_SimpleStringFlags">
int <code class="descname">PyRun_SimpleStringFlags</code><span class="sig-paren">(</span>const char<em>&nbsp;*command</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_SimpleStringFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes the Python source code from <em>command</em> in the <a class="reference internal" href="../library/__main__.html#module-__main__" title="__main__: The environment where the top-level script is run."><code class="xref py py-mod docutils literal"><span class="pre">__main__</span></code></a> module
according to the <em>flags</em> argument. If <a class="reference internal" href="../library/__main__.html#module-__main__" title="__main__: The environment where the top-level script is run."><code class="xref py py-mod docutils literal"><span class="pre">__main__</span></code></a> does not already exist, it
is created.  Returns <code class="docutils literal"><span class="pre">0</span></code> on success or <code class="docutils literal"><span class="pre">-1</span></code> if an exception was raised.  If
there was an error, there is no way to get the exception information. For the
meaning of <em>flags</em>, see below.</p>
<p>Note that if an otherwise unhandled <a class="reference internal" href="../library/exceptions.html#SystemExit" title="SystemExit"><code class="xref py py-exc docutils literal"><span class="pre">SystemExit</span></code></a> is raised, this
function will not return <code class="docutils literal"><span class="pre">-1</span></code>, but exit the process, as long as
<code class="docutils literal"><span class="pre">Py_InspectFlag</span></code> is not set.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_SimpleFile">
int <code class="descname">PyRun_SimpleFile</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_SimpleFile" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_SimpleFileExFlags" title="PyRun_SimpleFileExFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_SimpleFileExFlags()</span></code></a> below,
leaving <em>closeit</em> set to <code class="docutils literal"><span class="pre">0</span></code> and <em>flags</em> set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_SimpleFileEx">
int <code class="descname">PyRun_SimpleFileEx</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;closeit</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_SimpleFileEx" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_SimpleFileExFlags" title="PyRun_SimpleFileExFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_SimpleFileExFlags()</span></code></a> below,
leaving <em>flags</em> set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_SimpleFileExFlags">
int <code class="descname">PyRun_SimpleFileExFlags</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;closeit</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_SimpleFileExFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>Similar to <a class="reference internal" href="#c.PyRun_SimpleStringFlags" title="PyRun_SimpleStringFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_SimpleStringFlags()</span></code></a>, but the Python source code is read
from <em>fp</em> instead of an in-memory string. <em>filename</em> should be the name of
the file, it is decoded from the filesystem encoding
(<a class="reference internal" href="../library/sys.html#sys.getfilesystemencoding" title="sys.getfilesystemencoding"><code class="xref py py-func docutils literal"><span class="pre">sys.getfilesystemencoding()</span></code></a>).  If <em>closeit</em> is true, the file is
closed before PyRun_SimpleFileExFlags returns.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_InteractiveOne">
int <code class="descname">PyRun_InteractiveOne</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_InteractiveOne" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_InteractiveOneFlags" title="PyRun_InteractiveOneFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_InteractiveOneFlags()</span></code></a> below,
leaving <em>flags</em> set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_InteractiveOneFlags">
int <code class="descname">PyRun_InteractiveOneFlags</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_InteractiveOneFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>Read and execute a single statement from a file associated with an
interactive device according to the <em>flags</em> argument.  The user will be
prompted using <code class="docutils literal"><span class="pre">sys.ps1</span></code> and <code class="docutils literal"><span class="pre">sys.ps2</span></code>.  <em>filename</em> is decoded from the
filesystem encoding (<a class="reference internal" href="../library/sys.html#sys.getfilesystemencoding" title="sys.getfilesystemencoding"><code class="xref py py-func docutils literal"><span class="pre">sys.getfilesystemencoding()</span></code></a>).</p>
<p>Returns <code class="docutils literal"><span class="pre">0</span></code> when the input was
executed successfully, <code class="docutils literal"><span class="pre">-1</span></code> if there was an exception, or an error code
from the <code class="file docutils literal"><span class="pre">errcode.h</span></code> include file distributed as part of Python if
there was a parse error.  (Note that <code class="file docutils literal"><span class="pre">errcode.h</span></code> is not included by
<code class="file docutils literal"><span class="pre">Python.h</span></code>, so must be included specifically if needed.)</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_InteractiveLoop">
int <code class="descname">PyRun_InteractiveLoop</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_InteractiveLoop" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_InteractiveLoopFlags" title="PyRun_InteractiveLoopFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_InteractiveLoopFlags()</span></code></a> below,
leaving <em>flags</em> set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_InteractiveLoopFlags">
int <code class="descname">PyRun_InteractiveLoopFlags</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_InteractiveLoopFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>Read and execute statements from a file associated with an interactive device
until EOF is reached.  The user will be prompted using <code class="docutils literal"><span class="pre">sys.ps1</span></code> and
<code class="docutils literal"><span class="pre">sys.ps2</span></code>.  <em>filename</em> is decoded from the filesystem encoding
(<a class="reference internal" href="../library/sys.html#sys.getfilesystemencoding" title="sys.getfilesystemencoding"><code class="xref py py-func docutils literal"><span class="pre">sys.getfilesystemencoding()</span></code></a>).  Returns <code class="docutils literal"><span class="pre">0</span></code> at EOF.</p>
</dd></dl>

<dl class="var">
<dt id="c.PyOS_InputHook">
int <code class="descname">(*PyOS_InputHook)</code><span class="sig-paren">(</span>void<span class="sig-paren">)</span><a class="headerlink" href="#c.PyOS_InputHook" title="Permalink to this definition">¶</a></dt>
<dd><p>Can be set to point to a function with the prototype
<code class="docutils literal"><span class="pre">int</span> <span class="pre">func(void)</span></code>.  The function will be called when Python&#8217;s
interpreter prompt is about to become idle and wait for user input
from the terminal.  The return value is ignored.  Overriding this
hook can be used to integrate the interpreter&#8217;s prompt with other
event loops, as done in the <code class="file docutils literal"><span class="pre">Modules/_tkinter.c</span></code> in the
Python source code.</p>
</dd></dl>

<dl class="var">
<dt id="c.PyOS_ReadlineFunctionPointer">
char* <code class="descname">(*PyOS_ReadlineFunctionPointer)</code><span class="sig-paren">(</span>FILE<em>&nbsp;*</em>, FILE<em>&nbsp;*</em>, const char<em>&nbsp;*</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyOS_ReadlineFunctionPointer" title="Permalink to this definition">¶</a></dt>
<dd><p>Can be set to point to a function with the prototype
<code class="docutils literal"><span class="pre">char</span> <span class="pre">*func(FILE</span> <span class="pre">*stdin,</span> <span class="pre">FILE</span> <span class="pre">*stdout,</span> <span class="pre">char</span> <span class="pre">*prompt)</span></code>,
overriding the default function used to read a single line of input
at the interpreter&#8217;s prompt.  The function is expected to output
the string <em>prompt</em> if it&#8217;s not <em>NULL</em>, and then read a line of
input from the provided standard input file, returning the
resulting string.  For example, The <a class="reference internal" href="../library/readline.html#module-readline" title="readline: GNU readline support for Python. (Unix)"><code class="xref py py-mod docutils literal"><span class="pre">readline</span></code></a> module sets
this hook to provide line-editing and tab-completion features.</p>
<p>The result must be a string allocated by <a class="reference internal" href="memory.html#c.PyMem_RawMalloc" title="PyMem_RawMalloc"><code class="xref c c-func docutils literal"><span class="pre">PyMem_RawMalloc()</span></code></a> or
<a class="reference internal" href="memory.html#c.PyMem_RawRealloc" title="PyMem_RawRealloc"><code class="xref c c-func docutils literal"><span class="pre">PyMem_RawRealloc()</span></code></a>, or <em>NULL</em> if an error occurred.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 3.4: </span>The result must be allocated by <a class="reference internal" href="memory.html#c.PyMem_RawMalloc" title="PyMem_RawMalloc"><code class="xref c c-func docutils literal"><span class="pre">PyMem_RawMalloc()</span></code></a> or
<a class="reference internal" href="memory.html#c.PyMem_RawRealloc" title="PyMem_RawRealloc"><code class="xref c c-func docutils literal"><span class="pre">PyMem_RawRealloc()</span></code></a>, instead of being allocated by
<a class="reference internal" href="memory.html#c.PyMem_Malloc" title="PyMem_Malloc"><code class="xref c c-func docutils literal"><span class="pre">PyMem_Malloc()</span></code></a> or <a class="reference internal" href="memory.html#c.PyMem_Realloc" title="PyMem_Realloc"><code class="xref c c-func docutils literal"><span class="pre">PyMem_Realloc()</span></code></a>.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="c.PyParser_SimpleParseString">
struct _node* <code class="descname">PyParser_SimpleParseString</code><span class="sig-paren">(</span>const char<em>&nbsp;*str</em>, int<em>&nbsp;start</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyParser_SimpleParseString" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to
<a class="reference internal" href="#c.PyParser_SimpleParseStringFlagsFilename" title="PyParser_SimpleParseStringFlagsFilename"><code class="xref c c-func docutils literal"><span class="pre">PyParser_SimpleParseStringFlagsFilename()</span></code></a> below, leaving  <em>filename</em> set
to <em>NULL</em> and <em>flags</em> set to <code class="docutils literal"><span class="pre">0</span></code>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyParser_SimpleParseStringFlags">
struct _node* <code class="descname">PyParser_SimpleParseStringFlags</code><span class="sig-paren">(</span>const char<em>&nbsp;*str</em>, int<em>&nbsp;start</em>, int<em>&nbsp;flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyParser_SimpleParseStringFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to
<a class="reference internal" href="#c.PyParser_SimpleParseStringFlagsFilename" title="PyParser_SimpleParseStringFlagsFilename"><code class="xref c c-func docutils literal"><span class="pre">PyParser_SimpleParseStringFlagsFilename()</span></code></a> below, leaving  <em>filename</em> set
to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyParser_SimpleParseStringFlagsFilename">
struct _node* <code class="descname">PyParser_SimpleParseStringFlagsFilename</code><span class="sig-paren">(</span>const char<em>&nbsp;*str</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;start</em>, int<em>&nbsp;flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyParser_SimpleParseStringFlagsFilename" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse Python source code from <em>str</em> using the start token <em>start</em> according to
the <em>flags</em> argument.  The result can be used to create a code object which can
be evaluated efficiently. This is useful if a code fragment must be evaluated
many times. <em>filename</em> is decoded from the filesystem encoding
(<a class="reference internal" href="../library/sys.html#sys.getfilesystemencoding" title="sys.getfilesystemencoding"><code class="xref py py-func docutils literal"><span class="pre">sys.getfilesystemencoding()</span></code></a>).</p>
</dd></dl>

<dl class="function">
<dt id="c.PyParser_SimpleParseFile">
struct _node* <code class="descname">PyParser_SimpleParseFile</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;start</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyParser_SimpleParseFile" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a simplified interface to <a class="reference internal" href="#c.PyParser_SimpleParseFileFlags" title="PyParser_SimpleParseFileFlags"><code class="xref c c-func docutils literal"><span class="pre">PyParser_SimpleParseFileFlags()</span></code></a> below,
leaving <em>flags</em> set to <code class="docutils literal"><span class="pre">0</span></code>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyParser_SimpleParseFileFlags">
struct _node* <code class="descname">PyParser_SimpleParseFileFlags</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;start</em>, int<em>&nbsp;flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyParser_SimpleParseFileFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>Similar to <a class="reference internal" href="#c.PyParser_SimpleParseStringFlagsFilename" title="PyParser_SimpleParseStringFlagsFilename"><code class="xref c c-func docutils literal"><span class="pre">PyParser_SimpleParseStringFlagsFilename()</span></code></a>, but the Python
source code is read from <em>fp</em> instead of an in-memory string.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_String">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyRun_String</code><span class="sig-paren">(</span>const char<em>&nbsp;*str</em>, int<em>&nbsp;start</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*globals</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*locals</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_String" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: New reference.</em><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_StringFlags" title="PyRun_StringFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_StringFlags()</span></code></a> below, leaving
<em>flags</em> set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_StringFlags">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyRun_StringFlags</code><span class="sig-paren">(</span>const char<em>&nbsp;*str</em>, int<em>&nbsp;start</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*globals</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*locals</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_StringFlags" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: New reference.</em><p>Execute Python source code from <em>str</em> in the context specified by the
objects <em>globals</em> and <em>locals</em> with the compiler flags specified by
<em>flags</em>.  <em>globals</em> must be a dictionary; <em>locals</em> can be any object
that implements the mapping protocol.  The parameter <em>start</em> specifies
the start token that should be used to parse the source code.</p>
<p>Returns the result of executing the code as a Python object, or <em>NULL</em> if an
exception was raised.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_File">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyRun_File</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;start</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*globals</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*locals</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_File" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: New reference.</em><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_FileExFlags" title="PyRun_FileExFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_FileExFlags()</span></code></a> below, leaving
<em>closeit</em> set to <code class="docutils literal"><span class="pre">0</span></code> and <em>flags</em> set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_FileEx">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyRun_FileEx</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;start</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*globals</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*locals</em>, int<em>&nbsp;closeit</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_FileEx" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: New reference.</em><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_FileExFlags" title="PyRun_FileExFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_FileExFlags()</span></code></a> below, leaving
<em>flags</em> set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_FileFlags">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyRun_FileFlags</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;start</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*globals</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*locals</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_FileFlags" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: New reference.</em><p>This is a simplified interface to <a class="reference internal" href="#c.PyRun_FileExFlags" title="PyRun_FileExFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_FileExFlags()</span></code></a> below, leaving
<em>closeit</em> set to <code class="docutils literal"><span class="pre">0</span></code>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyRun_FileExFlags">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyRun_FileExFlags</code><span class="sig-paren">(</span>FILE<em>&nbsp;*fp</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;start</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*globals</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*locals</em>, int<em>&nbsp;closeit</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyRun_FileExFlags" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: New reference.</em><p>Similar to <a class="reference internal" href="#c.PyRun_StringFlags" title="PyRun_StringFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_StringFlags()</span></code></a>, but the Python source code is read from
<em>fp</em> instead of an in-memory string. <em>filename</em> should be the name of the file,
it is decoded from the filesystem encoding (<a class="reference internal" href="../library/sys.html#sys.getfilesystemencoding" title="sys.getfilesystemencoding"><code class="xref py py-func docutils literal"><span class="pre">sys.getfilesystemencoding()</span></code></a>).
If <em>closeit</em> is true, the file is closed before <a class="reference internal" href="#c.PyRun_FileExFlags" title="PyRun_FileExFlags"><code class="xref c c-func docutils literal"><span class="pre">PyRun_FileExFlags()</span></code></a>
returns.</p>
</dd></dl>

<dl class="function">
<dt id="c.Py_CompileString">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">Py_CompileString</code><span class="sig-paren">(</span>const char<em>&nbsp;*str</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;start</em><span class="sig-paren">)</span><a class="headerlink" href="#c.Py_CompileString" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: New reference.</em><p>This is a simplified interface to <a class="reference internal" href="#c.Py_CompileStringFlags" title="Py_CompileStringFlags"><code class="xref c c-func docutils literal"><span class="pre">Py_CompileStringFlags()</span></code></a> below, leaving
<em>flags</em> set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.Py_CompileStringFlags">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">Py_CompileStringFlags</code><span class="sig-paren">(</span>const char<em>&nbsp;*str</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;start</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em><span class="sig-paren">)</span><a class="headerlink" href="#c.Py_CompileStringFlags" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: New reference.</em><p>This is a simplified interface to <a class="reference internal" href="#c.Py_CompileStringExFlags" title="Py_CompileStringExFlags"><code class="xref c c-func docutils literal"><span class="pre">Py_CompileStringExFlags()</span></code></a> below, with
<em>optimize</em> set to <code class="docutils literal"><span class="pre">-1</span></code>.</p>
</dd></dl>

<dl class="function">
<dt id="c.Py_CompileStringObject">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">Py_CompileStringObject</code><span class="sig-paren">(</span>const char<em>&nbsp;*str</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*filename</em>, int<em>&nbsp;start</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em>, int<em>&nbsp;optimize</em><span class="sig-paren">)</span><a class="headerlink" href="#c.Py_CompileStringObject" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse and compile the Python source code in <em>str</em>, returning the resulting code
object.  The start token is given by <em>start</em>; this can be used to constrain the
code which can be compiled and should be <code class="xref py py-const docutils literal"><span class="pre">Py_eval_input</span></code>,
<code class="xref py py-const docutils literal"><span class="pre">Py_file_input</span></code>, or <code class="xref py py-const docutils literal"><span class="pre">Py_single_input</span></code>.  The filename specified by
<em>filename</em> is used to construct the code object and may appear in tracebacks or
<a class="reference internal" href="../library/exceptions.html#SyntaxError" title="SyntaxError"><code class="xref py py-exc docutils literal"><span class="pre">SyntaxError</span></code></a> exception messages.  This returns <em>NULL</em> if the code
cannot be parsed or compiled.</p>
<p>The integer <em>optimize</em> specifies the optimization level of the compiler; a
value of <code class="docutils literal"><span class="pre">-1</span></code> selects the optimization level of the interpreter as given by
<a class="reference internal" href="../using/cmdline.html#cmdoption-O"><code class="xref std std-option docutils literal"><span class="pre">-O</span></code></a> options.  Explicit levels are <code class="docutils literal"><span class="pre">0</span></code> (no optimization;
<code class="docutils literal"><span class="pre">__debug__</span></code> is true), <code class="docutils literal"><span class="pre">1</span></code> (asserts are removed, <code class="docutils literal"><span class="pre">__debug__</span></code> is false)
or <code class="docutils literal"><span class="pre">2</span></code> (docstrings are removed too).</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.4.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="c.Py_CompileStringExFlags">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">Py_CompileStringExFlags</code><span class="sig-paren">(</span>const char<em>&nbsp;*str</em>, const char<em>&nbsp;*filename</em>, int<em>&nbsp;start</em>, <a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*flags</em>, int<em>&nbsp;optimize</em><span class="sig-paren">)</span><a class="headerlink" href="#c.Py_CompileStringExFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#c.Py_CompileStringObject" title="Py_CompileStringObject"><code class="xref c c-func docutils literal"><span class="pre">Py_CompileStringObject()</span></code></a>, but <em>filename</em> is a byte string
decoded from the filesystem encoding (<a class="reference internal" href="../library/os.html#os.fsdecode" title="os.fsdecode"><code class="xref py py-func docutils literal"><span class="pre">os.fsdecode()</span></code></a>).</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.2.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="c.PyEval_EvalCode">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyEval_EvalCode</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*co</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*globals</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*locals</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyEval_EvalCode" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: New reference.</em><p>This is a simplified interface to <a class="reference internal" href="#c.PyEval_EvalCodeEx" title="PyEval_EvalCodeEx"><code class="xref c c-func docutils literal"><span class="pre">PyEval_EvalCodeEx()</span></code></a>, with just
the code object, and global and local variables.  The other arguments are
set to <em>NULL</em>.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyEval_EvalCodeEx">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyEval_EvalCodeEx</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*co</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*globals</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*locals</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;**args</em>, int<em>&nbsp;argcount</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;**kws</em>, int<em>&nbsp;kwcount</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;**defs</em>, int<em>&nbsp;defcount</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*kwdefs</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em>&nbsp;*closure</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyEval_EvalCodeEx" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluate a precompiled code object, given a particular environment for its
evaluation.  This environment consists of a dictionary of global variables,
a mapping object of local variables, arrays of arguments, keywords and
defaults, a dictionary of default values for <a class="reference internal" href="../glossary.html#keyword-only-parameter"><span>keyword-only</span></a> arguments and a closure tuple of cells.</p>
</dd></dl>

<dl class="type">
<dt id="c.PyFrameObject">
<code class="descname">PyFrameObject</code><a class="headerlink" href="#c.PyFrameObject" title="Permalink to this definition">¶</a></dt>
<dd><p>The C structure of the objects used to describe frame objects. The
fields of this type are subject to change at any time.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyEval_EvalFrame">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyEval_EvalFrame</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyFrameObject" title="PyFrameObject">PyFrameObject</a><em>&nbsp;*f</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyEval_EvalFrame" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluate an execution frame.  This is a simplified interface to
<a class="reference internal" href="#c.PyEval_EvalFrameEx" title="PyEval_EvalFrameEx"><code class="xref c c-func docutils literal"><span class="pre">PyEval_EvalFrameEx()</span></code></a>, for backward compatibility.</p>
</dd></dl>

<dl class="function">
<dt id="c.PyEval_EvalFrameEx">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyEval_EvalFrameEx</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyFrameObject" title="PyFrameObject">PyFrameObject</a><em>&nbsp;*f</em>, int<em>&nbsp;throwflag</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyEval_EvalFrameEx" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the main, unvarnished function of Python interpretation.  It is
literally 2000 lines long.  The code object associated with the execution
frame <em>f</em> is executed, interpreting bytecode and executing calls as needed.
The additional <em>throwflag</em> parameter can mostly be ignored - if true, then
it causes an exception to immediately be thrown; this is used for the
<a class="reference internal" href="../reference/expressions.html#generator.throw" title="generator.throw"><code class="xref py py-meth docutils literal"><span class="pre">throw()</span></code></a> methods of generator objects.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 3.4: </span>This function now includes a debug assertion to help ensure that it
does not silently discard an active exception.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="c.PyEval_MergeCompilerFlags">
int <code class="descname">PyEval_MergeCompilerFlags</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyCompilerFlags" title="PyCompilerFlags">PyCompilerFlags</a><em>&nbsp;*cf</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyEval_MergeCompilerFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>This function changes the flags of the current evaluation frame, and returns
true on success, false on failure.</p>
</dd></dl>

<dl class="var">
<dt id="c.Py_eval_input">
int <code class="descname">Py_eval_input</code><a class="headerlink" href="#c.Py_eval_input" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-0">The start symbol from the Python grammar for isolated expressions; for use with
<a class="reference internal" href="#c.Py_CompileString" title="Py_CompileString"><code class="xref c c-func docutils literal"><span class="pre">Py_CompileString()</span></code></a>.</p>
</dd></dl>

<dl class="var">
<dt id="c.Py_file_input">
int <code class="descname">Py_file_input</code><a class="headerlink" href="#c.Py_file_input" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-1">The start symbol from the Python grammar for sequences of statements as read
from a file or other source; for use with <a class="reference internal" href="#c.Py_CompileString" title="Py_CompileString"><code class="xref c c-func docutils literal"><span class="pre">Py_CompileString()</span></code></a>.  This is
the symbol to use when compiling arbitrarily long Python source code.</p>
</dd></dl>

<dl class="var">
<dt id="c.Py_single_input">
int <code class="descname">Py_single_input</code><a class="headerlink" href="#c.Py_single_input" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-2">The start symbol from the Python grammar for a single statement; for use with
<a class="reference internal" href="#c.Py_CompileString" title="Py_CompileString"><code class="xref c c-func docutils literal"><span class="pre">Py_CompileString()</span></code></a>. This is the symbol used for the interactive
interpreter loop.</p>
</dd></dl>

<dl class="type">
<dt id="c.PyCompilerFlags">
struct <code class="descname">PyCompilerFlags</code><a class="headerlink" href="#c.PyCompilerFlags" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the structure used to hold compiler flags.  In cases where code is only
being compiled, it is passed as <code class="docutils literal"><span class="pre">int</span> <span class="pre">flags</span></code>, and in cases where code is being
executed, it is passed as <code class="docutils literal"><span class="pre">PyCompilerFlags</span> <span class="pre">*flags</span></code>.  In this case, <code class="docutils literal"><span class="pre">from</span>
<span class="pre">__future__</span> <span class="pre">import</span></code> can modify <em>flags</em>.</p>
<p>Whenever <code class="docutils literal"><span class="pre">PyCompilerFlags</span> <span class="pre">*flags</span></code> is <em>NULL</em>, <code class="xref py py-attr docutils literal"><span class="pre">cf_flags</span></code> is treated as
equal to <code class="docutils literal"><span class="pre">0</span></code>, and any modification due to <code class="docutils literal"><span class="pre">from</span> <span class="pre">__future__</span> <span class="pre">import</span></code> is
discarded.</p>
<div class="highlight-c"><div class="highlight"><pre><span></span><span class="k">struct</span> <span class="n">PyCompilerFlags</span> <span class="p">{</span>
    <span class="kt">int</span> <span class="n">cf_flags</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
</dd></dl>

<dl class="var">
<dt id="c.CO_FUTURE_DIVISION">
int <code class="descname">CO_FUTURE_DIVISION</code><a class="headerlink" href="#c.CO_FUTURE_DIVISION" title="Permalink to this definition">¶</a></dt>
<dd><p>This bit can be set in <em>flags</em> to cause division operator <code class="docutils literal"><span class="pre">/</span></code> to be
interpreted as &#8220;true division&#8221; according to <span class="target" id="index-3"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0238"><strong>PEP 238</strong></a>.</p>
</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="stable.html"
                        title="previous chapter">Stable Application Binary Interface</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="refcounting.html"
                        title="next chapter">Reference Counting</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../bugs.html">Report a Bug</a></li>
      <li><a href="../_sources/c-api/veryhigh.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
  </div>
        </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="refcounting.html" title="Reference Counting"
             >next</a> |</li>
        <li class="right" >
          <a href="stable.html" title="Stable Application Binary Interface"
             >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> &raquo;</li>
        <li>
          <span class="version_switcher_placeholder">3.5.3</span>
          <a href="../index.html">Documentation </a> &raquo;
        </li>

          <li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> &raquo;</li>
    <li class="right">
        

    <div class="inline-search" style="display: none" role="search">
        <form class="inline-search" action="../search.html" method="get">
          <input placeholder="Quick search" type="text" name="q" />
          <input type="submit" value="Go" />
          <input type="hidden" name="check_keywords" value="yes" />
          <input type="hidden" name="area" value="default" />
        </form>
    </div>
    <script type="text/javascript">$('.inline-search').show(0);</script>
         |
    </li>

      </ul>
    </div>  
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 2001-2017, 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 Jan 20, 2017.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
    </div>

  </body>
</html>