Function | _c_compile |
Undocumented |
Function | _convert_str_to_file |
Helper function to create a file source.c in dirname that contains the string in source . Returns the file name |
Function | _make_methods |
No summary |
Function | _make_source |
Combines the code fragments into source code ready to be compiled |
Function | build |
cd into the directory where the cfile is, use distutils to build |
Function | build_and_import_extension |
Build and imports a c-extension module modname from a list of function fragments functions . |
Function | compile_extension_module |
Build an extension module and return the filename of the resulting native code file. |
Function | get_so_suffix |
Undocumented |
dirname
that contains
the string in source
. Returns the file nameBuild and imports a c-extension module modname
from a list of function
fragments functions
.
>>> functions = [("test_bytes", "METH_O", """ if ( !PyBytesCheck(args)) { Py_RETURN_FALSE; } Py_RETURN_TRUE; """)] >>> mod = build_and_import_extension("testme", functions) >>> assert not mod.test_bytes(u'abc') >>> assert mod.test_bytes(b'abc')
Build an extension module and return the filename of the resulting native code file.