/python-c-extension-examples

Trying to giving basic examples for how to write C extensions for Python 3.5

Primary LanguageC

About Repository: This repo will host some examples for "writing C extensions for Python 3.x". Our first example is calculator. It has 4 basit arithmetic functions. You can find all of comments in the files. I tried to explain what is happening line by line.

Example Structrue: One or more ".c, .h etc." files that contains C extension codes. A setup.py file that contains installing codes and parameters. An sample.py file that shows how to use that extension.

How Can I Install And Try the Extension Examples ?: 1- Create a virtualenv.(Optional*) 2- Go to the project directory and run "python setup.py install" 3- Check the sample.py for learning how to use the extension. That's it !

Can you help me ?: If you have some example ideas or you know how to write C extension for Python, please help me and commit some examples or updates.