Inline C/C++ code within Python scripts.
inline() compiles and executes C/C++ code on the fly. Variables in the local and global Python scope are also available in the C/C++ code. Values are passed to the C/C++ code by assignment much like variables passed are passed into a standard Python function. Values are returned from the C/C++ code through a special argument called return_val. Also, the contents of mutable objects can be changed within the C/C++ code and the changes remain after the C code exits and returns to Python.
inline has quite a few options as listed below. Also, the keyword arguments for distutils extension modules are accepted to specify extra information needed for compiling.
Parameters : | code : string
arg_names : [str], optional
local_dict : dict, optional
global_dict : dict, optional
force : {0, 1}, optional
compiler : str, optional
verbose : {0,1,2}, optional
support_code : str, optional
headers : [str], optional
customize : base_info.custom_info, optional
type_converters : [type converters], optional
auto_downcast : {1,0}, optional
newarr_converter : int, optional
|
---|---|
Other Parameters: | |
Relevant :mod:`distutils` keywords. These are duplicated from Greg Ward’s : :class:`distutils.extension.Extension` class for convenience: : sources : [string]
include_dirs : [string]
define_macros : [(name
undef_macros : [string]
library_dirs : [string]
libraries : [string]
runtime_library_dirs : [string]
extra_objects : [string]
extra_compile_args : [string]
extra_link_args : [string]
export_symbols : [string]
swig_opts : [string]
depends : [string]
language : string
|
See also