20.4. Exercises

20-1. Extending Python. What are some of the advantages of Python extensions?

20-2. Extending Python. Can you see any disadvantages or dangers from using extensions?

20-3. Writing Extensions. Obtain or find a C/C++ compiler and write a small program with it to (re)familiarize yourself with C/C++ programming. Find your Python distribution directory and locate the Misc/Makefile.pre.in file. Take the program you just wrote and wrap it in Python. Go through the steps necessary to create a shared object. Access that module from Python and test it.

20-4. Porting from Python to C. Take several of the exercises you did in earlier chapters and port them to C/C++ as extension modules.

20-5. Wrapping C Code. Find a piece of C/C++ code which ...

Get Core Python Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.