@@ -7,6 +7,9 @@ Extending/Embedding FAQ
77.. highlight :: c
88
99
10+ .. XXX need review for Python 3.
11+
12+
1013 Can I create my own functions in C?
1114-----------------------------------
1215
@@ -53,8 +56,7 @@ with a tool such as `SWIG <http://www.swig.org>`_. `SIP
5356<http://www.riverbankcomputing.co.uk/software/sip/> `__, `CXX
5457<http://cxx.sourceforge.net/> `_ `Boost
5558<http://www.boost.org/libs/python/doc/index.html> `_, or `Weave
56- <http://www.scipy.org/Weave> `_ are also alternatives for wrapping
57- C++ libraries.
59+ <http://www.scipy.org/Weave> `_ are also alternatives for wrapping C++ libraries.
5860
5961
6062How can I execute arbitrary Python statements from C?
@@ -161,8 +163,8 @@ Sample code and use for catching stdout:
161163 ...
162164 >>> import sys
163165 >>> sys.stdout = StdoutCatcher()
164- >>> print ' foo'
165- >>> print ' hello world!'
166+ >>> print ( ' foo' )
167+ >>> print ( ' hello world!' )
166168 >>> sys.stderr.write(sys.stdout.data)
167169 foo
168170 hello world!
@@ -199,7 +201,11 @@ begin by reading :ref:`the "Extending and Embedding" document
199201whole lot of difference between C and C++ -- so the strategy of building a new
200202Python type around a C structure (pointer) type will also work for C++ objects.
201203
202- For C++ libraries, see :ref: `c-wrapper-software `.
204+ For C++ libraries, you can look at `SIP
205+ <http://www.riverbankcomputing.co.uk/sip/> `_, `CXX
206+ <http://cxx.sourceforge.net/> `_, `Boost
207+ <http://www.boost.org/libs/python/doc/index.html> `_, `Weave
208+ <http://www.scipy.org/Weave> `_ or `SWIG <http://www.swig.org >`_
203209
204210
205211I added a module using the Setup file and the make fails; why?
@@ -468,12 +474,9 @@ checking the value of sys.maxunicode:
468474
469475 >>> import sys
470476 >>> if sys.maxunicode > 65535 :
471- ... print ' UCS4 build'
477+ ... print ( ' UCS4 build' )
472478 ... else :
473- ... print ' UCS2 build'
479+ ... print ( ' UCS2 build' )
474480
475481The only way to solve this problem is to use extension modules compiled with a
476482Python binary built using the same size for Unicode characters.
477-
478-
479-
0 commit comments