I. Introduction:
1. File Inclusion:
ProgramAll the functions, types, and macros used in the file include:
# Include "python. H"
In this example, the standard header file <limits. h> and <stdlib. h> are implicitly included (if available)
Note: Python may have some pre-processing definitions on some systems that affect the standard library functions. You must include python. h before defining the standard header file.
All user-visible functions on python. h usually start with Py _ or _ Py, and all names starting with Py _ are mainly used for internal implementation of Python and should not be used by external programs. There are no restrictions on the naming of struct members.
Important: User-Defined code should never start with Py _ or _ Py, which may mislead readers and make it inconvenient to maintain and port later versions, if you want to use these names later. On UNIX, these header files are usually located in prefix/include/pythonversion/and exec_prefix/include/pythonversion /. Pre-fix and exec_prefix are installed Python versions.
C ++ users should note that these APIs are completed and implemented in C. The header file declares extern "C" in due time, So C ++ calls do not need to do anything special.