Thursday, November 12, 2015

How to use C code in Python

Python and C combination is brilliant for programmers specially who writing network tools and exploits. For this purpose there are many ways to use both of them in one code and make the use of both languages. Previous days I was looking for a easy way(not easy actually fast way to approach my object which is make use of c code inside a python code) to do this. I was noticed there are many ways to do this. Some of them are,

  1. According to Extending Python with C doc (https://docs.python.org/2/extending/extending.html).
  2. Some languages has built in combine with features of these two languages such as Pyrex, Cython.
  3. Using ctype module.
  4. Using a SWIG (Simple Wrapper Interface Generator)