Passing Parameters from Python to C

After you have everything built and installed, importing your new extension module and invoking its one function is easy If you tried to pass in any arguments to your function, the interpreter will rightfully complain If you tried to pass in any arguments to your function, the interpreter will rightfully complain Because you'll most likely want to define functions that do accept arguments, you can use one of the other signatures for your C functions. For example, a normal function (one that...

MIME Multipart Messages

This isn't quite the e-mail message described earlier. That message was a short piece of text (Here's that picture I took of you.) and an attached image. This message is just the image. There's no space for the text portion in the body of the message putting it there would compromise the image file. The Content-Type header of a mail message can be text plain or image jpeg it can't be both. So how do mail clients create messages with attachments In addition to...

The LAME Project

LAME is (or was) an acronym that originally stood for LAME Ain't an MP3 Encoder. Whether it's officially considered an MP3 encoder or not isn't important to you, because it functions as a (most excellent) free and open-source library that is capable of encoding MP3s. Dozens of software projects use LAME but not many are implemented in Python, which is why you'll be using it as an example to demonstrate just how easy it is to create extension modules for Python that leverage an existing C code...