| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="ext.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="ext.html" title='Extending and Embedding the Python Interpreter' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='last' href='about.html' title='About this document...' /> |
| 10 | <link rel='help' href='about.html' title='About this document...' /> |
| 11 | <link rel="next" href="front.html" /> |
| 12 | <meta name='aesop' content='information' /> |
| 13 | <title>Extending and Embedding the Python Interpreter</title> |
| 14 | </head> |
| 15 | <body> |
| 16 | <DIV CLASS="navigation"> |
| 17 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 18 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 19 | <tr> |
| 20 | <td class='online-navigation'><img src='../icons/previous.png' |
| 21 | border='0' height='32' alt='Previous Page' width='32' /></td> |
| 22 | <td class='online-navigation'><a rel="parent" title="Python Documentation Index" |
| 23 | href="../index.html"><img src='../icons/up.png' |
| 24 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 25 | <td class='online-navigation'><a rel="next" title="Front Matter" |
| 26 | href="front.html"><img src='../icons/next.png' |
| 27 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 28 | <td align="center" width="100%">Extending and Embedding the Python Interpreter</td> |
| 29 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 30 | href="contents.html"><img src='../icons/contents.png' |
| 31 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 32 | <td class='online-navigation'><img src='../icons/blank.png' |
| 33 | border='0' height='32' alt='' width='32' /></td> |
| 34 | <td class='online-navigation'><img src='../icons/blank.png' |
| 35 | border='0' height='32' alt='' width='32' /></td> |
| 36 | </tr></table> |
| 37 | <div class='online-navigation'> |
| 38 | <b class="navlabel">Up:</b> |
| 39 | <a class="sectref" rel="parent" href="../index.html">Python Documentation Index</A> |
| 40 | <b class="navlabel">Next:</b> |
| 41 | <a class="sectref" rel="next" href="front.html">Front Matter</A> |
| 42 | </div> |
| 43 | <hr /></div> |
| 44 | </DIV> |
| 45 | <!--End of Navigation Panel--> |
| 46 | |
| 47 | <P> |
| 48 | |
| 49 | <link rel='up' href='../index.html' title='Python Documentation Index' /> |
| 50 | <div class="titlepage"> |
| 51 | <div class='center'> |
| 52 | <h1>Extending and Embedding the Python Interpreter</h1> |
| 53 | <p><b><font size="+2">Guido van Rossum</font></b></p> |
| 54 | <p> |
| 55 | <strong>Python Software Foundation</strong> |
| 56 | <BR> |
| 57 | Email: <span class="email">docs@python.org</span> |
| 58 | </p> |
| 59 | <p><i> Fred L. Drake, Jr., editor</i></p> |
| 60 | <p><strong>Release 2.4.2</strong><br /> |
| 61 | <strong>28 September 2005</strong></p> |
| 62 | <p></p> |
| 63 | </div> |
| 64 | </div> |
| 65 | |
| 66 | <P> |
| 67 | |
| 68 | <p><br /></p><hr class='online-navigation' /> |
| 69 | <div class='online-navigation'> |
| 70 | <!--Table of Child-Links--> |
| 71 | <A NAME="CHILD_LINKS"></a> |
| 72 | |
| 73 | <UL CLASS="ChildLinks"> |
| 74 | <LI><A href="front.html">Front Matter</a> |
| 75 | <LI><A href="contents.html">Contents</a> |
| 76 | <LI><A href="intro.html">1. Extending Python with C or C++</a> |
| 77 | <UL> |
| 78 | <LI><A href="simpleExample.html">1.1 A Simple Example</a> |
| 79 | <LI><A href="errors.html">1.2 Intermezzo: Errors and Exceptions</a> |
| 80 | <LI><A href="backToExample.html">1.3 Back to the Example</a> |
| 81 | <LI><A href="methodTable.html">1.4 The Module's Method Table and Initialization Function</a> |
| 82 | <LI><A href="compilation.html">1.5 Compilation and Linkage</a> |
| 83 | <LI><A href="callingPython.html">1.6 Calling Python Functions from C</a> |
| 84 | <LI><A href="parseTuple.html">1.7 Extracting Parameters in Extension Functions</a> |
| 85 | <LI><A href="parseTupleAndKeywords.html">1.8 Keyword Parameters for Extension Functions</a> |
| 86 | <LI><A href="buildValue.html">1.9 Building Arbitrary Values</a> |
| 87 | <LI><A href="refcounts.html">1.10 Reference Counts</a> |
| 88 | <UL> |
| 89 | <LI><A href="refcountsInPython.html">1.10.1 Reference Counting in Python</a> |
| 90 | <LI><A href="ownershipRules.html">1.10.2 Ownership Rules</a> |
| 91 | <LI><A href="thinIce.html">1.10.3 Thin Ice</a> |
| 92 | <LI><A href="nullPointers.html">1.10.4 NULL Pointers</a> |
| 93 | </ul> |
| 94 | <LI><A href="cplusplus.html">1.11 Writing Extensions in C++</a> |
| 95 | <LI><A href="using-cobjects.html">1.12 Providing a C API for an Extension Module</a> |
| 96 | </ul> |
| 97 | <LI><A href="defining-new-types.html">2. Defining New Types</a> |
| 98 | <UL> |
| 99 | <LI><A href="dnt-basics.html">2.1 The Basics</a> |
| 100 | <UL> |
| 101 | <LI><A href="node22.html">2.1.1 Adding data and methods to the Basic example</a> |
| 102 | <LI><A href="node23.html">2.1.2 Providing finer control over data attributes</a> |
| 103 | <LI><A href="node24.html">2.1.3 Supporting cyclic garbage collection</a> |
| 104 | </ul> |
| 105 | <LI><A href="dnt-type-methods.html">2.2 Type Methods</a> |
| 106 | <UL> |
| 107 | <LI><A href="node26.html">2.2.1 Finalization and De-allocation</a> |
| 108 | <LI><A href="node27.html">2.2.2 Object Presentation</a> |
| 109 | <LI><A href="node28.html">2.2.3 Attribute Management</a> |
| 110 | <LI><A href="node31.html">2.2.4 Object Comparison</a> |
| 111 | <LI><A href="node32.html">2.2.5 Abstract Protocol Support</a> |
| 112 | <LI><A href="node33.html">2.2.6 More Suggestions</a> |
| 113 | </ul> |
| 114 | </ul> |
| 115 | <LI><A href="building.html">3. Building C and C++ Extensions with distutils</a> |
| 116 | <UL> |
| 117 | <LI><A href="distributing.html">3.1 Distributing your extension modules</a> |
| 118 | </ul> |
| 119 | <LI><A href="building-on-windows.html">4. Building C and C++ Extensions on Windows</a> |
| 120 | <UL> |
| 121 | <LI><A href="win-cookbook.html">4.1 A Cookbook Approach</a> |
| 122 | <LI><A href="dynamic-linking.html">4.2 Differences Between <span class="Unix">Unix</span> and Windows</a> |
| 123 | <LI><A href="win-dlls.html">4.3 Using DLLs in Practice</a> |
| 124 | </ul> |
| 125 | <LI><A href="embedding.html">5. Embedding Python in Another Application</a> |
| 126 | <UL> |
| 127 | <LI><A href="high-level-embedding.html">5.1 Very High Level Embedding</a> |
| 128 | <LI><A href="lower-level-embedding.html">5.2 Beyond Very High Level Embedding: An overview</a> |
| 129 | <LI><A href="pure-embedding.html">5.3 Pure Embedding</a> |
| 130 | <LI><A href="extending-with-embedding.html">5.4 Extending Embedded Python</a> |
| 131 | <LI><A href="embeddingInCplusplus.html">5.5 Embedding Python in C++</a> |
| 132 | <LI><A href="link-reqs.html">5.6 Linking Requirements</a> |
| 133 | </ul> |
| 134 | <LI><A href="reporting-bugs.html">A. Reporting Bugs</a> |
| 135 | <LI><A href="node48.html">B. History and License</a> |
| 136 | <UL> |
| 137 | <LI><A href="node49.html">B.1 History of the software</a> |
| 138 | <LI><A href="node50.html">B.2 Terms and conditions for accessing or otherwise using Python</a> |
| 139 | <LI><A href="node51.html">B.3 Licenses and Acknowledgements for Incorporated Software</a> |
| 140 | <UL> |
| 141 | <LI><A href="node52.html">B.3.1 Mersenne Twister</a> |
| 142 | <LI><A href="node53.html">B.3.2 Sockets</a> |
| 143 | <LI><A href="node54.html">B.3.3 Floating point exception control</a> |
| 144 | <LI><A href="node55.html">B.3.4 MD5 message digest algorithm</a> |
| 145 | <LI><A href="node56.html">B.3.5 Asynchronous socket services</a> |
| 146 | <LI><A href="node57.html">B.3.6 Cookie management</a> |
| 147 | <LI><A href="node58.html">B.3.7 Profiling</a> |
| 148 | <LI><A href="node59.html">B.3.8 Execution tracing</a> |
| 149 | <LI><A href="node60.html">B.3.9 UUencode and UUdecode functions</a> |
| 150 | <LI><A href="node61.html">B.3.10 XML Remote Procedure Calls</a> |
| 151 | </ul> |
| 152 | </ul> |
| 153 | <LI><A href="about.html">About this document ...</a> |
| 154 | </ul> |
| 155 | <!--End of Table of Child-Links--> |
| 156 | </div> |
| 157 | |
| 158 | <DIV CLASS="navigation"> |
| 159 | <div class='online-navigation'> |
| 160 | <p></p><hr /> |
| 161 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 162 | <tr> |
| 163 | <td class='online-navigation'><img src='../icons/previous.png' |
| 164 | border='0' height='32' alt='Previous Page' width='32' /></td> |
| 165 | <td class='online-navigation'><a rel="parent" title="Python Documentation Index" |
| 166 | href="../index.html"><img src='../icons/up.png' |
| 167 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 168 | <td class='online-navigation'><a rel="next" title="Front Matter" |
| 169 | href="front.html"><img src='../icons/next.png' |
| 170 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 171 | <td align="center" width="100%">Extending and Embedding the Python Interpreter</td> |
| 172 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 173 | href="contents.html"><img src='../icons/contents.png' |
| 174 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 175 | <td class='online-navigation'><img src='../icons/blank.png' |
| 176 | border='0' height='32' alt='' width='32' /></td> |
| 177 | <td class='online-navigation'><img src='../icons/blank.png' |
| 178 | border='0' height='32' alt='' width='32' /></td> |
| 179 | </tr></table> |
| 180 | <div class='online-navigation'> |
| 181 | <b class="navlabel">Up:</b> |
| 182 | <a class="sectref" rel="parent" href="../index.html">Python Documentation Index</A> |
| 183 | <b class="navlabel">Next:</b> |
| 184 | <a class="sectref" rel="next" href="front.html">Front Matter</A> |
| 185 | </div> |
| 186 | </div> |
| 187 | <hr /> |
| 188 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 189 | </DIV> |
| 190 | <!--End of Navigation Panel--> |
| 191 | <ADDRESS> |
| 192 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 193 | </ADDRESS> |
| 194 | </BODY> |
| 195 | </HTML> |