Also make sure that the file names used in task.json are correct and that example compiles.
In future chapters we will simply add functions to this module and add them to the method definition. This saves having to repeat the same task.json and launch.json files.
Summary
The main principle of the C API is that all Python objects are represented by a specific C Struct that is an extension of PyObject and as a result any Python object can be referenced by a PyObject*
The C API contains many of the functions that implement Python. In many cases there is a simple equivalence between Python functions and C functions.
Every module has an initialization function with the name PyInit_modulename.
The initialization function is called when the module is imported and it creates the module object and returns it.
The PyModuleDef struct has fields that determine how the module will be treated by the system.
An array of PyMethodDef structs specifies the methods/functions that the module provides.
The PyArg_ParseTuple function can be used to parse the tuple of arguments passed to the function.
A simple calculation demonstrates that converting a Python function to C can speed it up by a factor of roughly 50.
To avoid having to change the compiler settings, a standard example extension is used in the rest of this book.
Robots that enthusiasts could build for under $500, and that are smart enough to walk off the 3D printer that formed them, have been demonstrated by a team at the University of Edinburgh.
Google has released a beta version of Opal, a tool that can describe, create, and share AI mini-apps. Google describes Opal as a tool to accelerate prototyping AI ideas and workflows, demonstrat [ ... ]