@@ -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
@@ -51,8 +54,7 @@ with a tool such as `SWIG <http://www.swig.org>`_. `SIP
5154<http://www.riverbankcomputing.co.uk/software/sip/> `__, `CXX
5255<http://cxx.sourceforge.net/> `_ `Boost
5356<http://www.boost.org/libs/python/doc/index.html> `_, or `Weave
54- <http://www.scipy.org/site_content/weave> `_ are also alternatives for wrapping
55- C++ libraries.
57+ <http://www.scipy.org/Weave> `_ are also alternatives for wrapping C++ libraries.
5658
5759
5860How can I execute arbitrary Python statements from C?
@@ -159,8 +161,8 @@ Sample code and use for catching stdout:
159161 ...
160162 >>> import sys
161163 >>> sys.stdout = StdoutCatcher()
162- >>> print ' foo'
163- >>> print ' hello world!'
164+ >>> print ( ' foo' )
165+ >>> print ( ' hello world!' )
164166 >>> sys.stderr.write(sys.stdout.data)
165167 foo
166168 hello world!
@@ -201,7 +203,7 @@ For C++ libraries, you can look at `SIP
201203<http://www.riverbankcomputing.co.uk/sip/> `_, `CXX
202204<http://cxx.sourceforge.net/> `_, `Boost
203205<http://www.boost.org/libs/python/doc/index.html> `_, `Weave
204- <http://www.scipy.org/site_content/weave > `_ or `SWIG <http://www.swig.org >`_
206+ <http://www.scipy.org/Weave > `_ or `SWIG <http://www.swig.org >`_
205207
206208
207209I added a module using the Setup file and the make fails; why?
@@ -470,12 +472,9 @@ checking the value of sys.maxunicode:
470472
471473 >>> import sys
472474 >>> if sys.maxunicode > 65535 :
473- ... print ' UCS4 build'
475+ ... print ( ' UCS4 build' )
474476 ... else :
475- ... print ' UCS2 build'
477+ ... print ( ' UCS2 build' )
476478
477479The only way to solve this problem is to use extension modules compiled with a
478480Python binary built using the same size for Unicode characters.
479-
480-
481-
0 commit comments