In a python script(module) any global function call will be executed each time I import/reload module. I call these module-level initialization function.
ex.
def init():
print "Hello, this is module initialization function"
print "init() has been called"
init()
Every time I import this module/reload it will print these lines.
Currently I have a Python/C API module, that I want to add module-level initialization function.
Is this possible to do using this approach ?
Another possible solution that I know, I may add another normal function, then call it via PyRun_String
or other functions of the C-API.