How to Reload a Python3 C extension module?
问题 I wrote a C extension (mycext.c) for Python 3.2. The extension relies on constant data stored in a C header (myconst.h). The header file is generated by a Python script. In the same script, I make use of the recently compiled module. The workflow in the Python3 myscript (not shown completely) is as follows: configure_C_header_constants() write_constants_to_C_header() # write myconst.h os.system('python3 setup.py install --user') # compile mycext import mycext mycext.do_stuff() This works