© Joey Bernard 2016

Joey Bernard, Python Recipes Handbook, 10.1007/978-1-4842-0241-8_15

15. C and Other Extensions

Joey Bernard

(1)Fredericton, New Brunswick, Canada

One of the great things about Python is that it is not the best tool for every job, and more importantly, it knows that it isn't the best tool for every job. Because of this self-awareness, Python was designed from the beginning to be extensible with code written in C. This capability is provided by a module called Cython, which is available from http://cython.org . In this chapter, you will look at some of the different ways you can include Cython within your own Python programs in order to improve its performance or add extra functionality.

15-1. Compiling Python Code

Problem

You want ...

Get Python Recipes Handbook: A Problem-Solution Approach 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.