<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!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>pyinit Opcodes</title> <link rel="stylesheet" type="text/css" href="csound.css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="pyexec.html" title="pyexec Opcodes" /> <link rel="next" href="pyrun.html" title="pyrun Opcodes" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">pyinit Opcodes</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="pyexec.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="pyrun.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="pyinit Opcodes"> <a id="pyinit"></a> <div class="titlepage"></div> <a id="IndexPyInit" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">pyinit Opcodes</span> </h2> <p>pyinit — Initialize the Python interpreter. </p> </div> <div class="refsect1" title="Syntax"> <a id="idp39643712"></a> <h2>Syntax</h2> <pre class="synopsis"> <span class="command"> <strong>pyinit</strong> </span> </pre> </div> <div class="refsect1" title="Description"> <a id="idp39644664"></a> <h2>Description</h2> <p>In the command-line version of Csound, you must first invoke the <span class="emphasis"><em>pyinit</em></span> opcode in the orchestra header to initialize the Python interpreter, before using any of the other Python opcodes.</p> <p>But if you use the Python opcodes in the CsoundAC version of Csound, you need not invoke <span class="emphasis"><em>pyinit</em></span>, because CsoundAC automatically initializes the Python interpreter for you. In addition, CsoundAC automatically creates a Python interface to the Csound API, in the form a global instance of the <code class="literal">CsoundAC.CppSound</code> class named <code class="literal">csound</code>. Therefore, Python code written in the Csound orchestra has access to the global <code class="literal">csound</code> object.</p> </div> <div class="refsect1" title="Credits"> <a id="idp39649888"></a> <h2>Credits</h2> <p>Copyright (c) 2002 by Maurizio Umberto Puxeddu. All rights reserved. Portions copyright (c) 2004 and 2005 by Michael Gogins. This document has been updated Sunday 25 July 2004 and 1 February 2005 by Michael Gogins.</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="pyexec.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="pyrun.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">pyexec Opcodes </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> pyrun Opcodes</td> </tr> </table> </div> </body> </html>