pyinit Opcodes

pyinit — Initialize the Python interpreter.




In the command-line version of Csound, you must first invoke the pyinit opcode in the orchestra header to initialize the Python interpreter, before using any of the other Python opcodes.

But if you use the Python opcodes in the CsoundAC version of Csound, you need not invoke pyinit, 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 CsoundAC.CppSound class named csound. Therefore, Python code written in the Csound orchestra has access to the global csound object.


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.