Skip to Main Content
Programming Python, 3rd Edition
book

Programming Python, 3rd Edition

by Mark Lutz
August 2006
Intermediate to advanced content levelIntermediate to advanced
1600 pages
51h 46m
English
O'Reilly Media, Inc.
Content preview from Programming Python, 3rd Edition

Part VI. Integration

This part of the book explores Python’s interfaces for in-process communication with software components written in other programming languages. Its emphasis is on mixing Python with programs written in C and C++, but other integration techniques are also introduced along the way. This part contains two chapters that address the two primary modes of Python/C integration:

Chapter 22, Extending Python

This chapter presents tools that allow Python scripts to call out to C components. C components take the form of new modules or object types. Extending is used as an optimization technique, as an escape mechanism for performing tasks outside the Python language, and as a way to leverage existing libraries. This chapter also covers SWIG—a system that automatically generates the glue code needed to export C and C++ libraries to Python scripts and hides much of the complexity underlying extensions.

Chapter 23, Embedding Python

This chapter presents tools that allow C programs to execute Python scripts. These tools live in the Python runtime API—a collection of functions exposed by the Python interpreter and linked into your C/C++ program. Embedding is often used as a customization mechanism and for routing events back to Python code. This chapter concludes with a look at other integration topics and systems: Jython, COM, CORBA, and so on.

This part of the book assumes that you know how to read C programs, and it is useful mostly to developers responsible for implementing ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Python, 3rd Edition

Learning Python, 3rd Edition

Mark Lutz

Publisher Resources

ISBN: 0596009259Supplemental ContentErrata Page