When importing a custom module, I would like a given initialize()
function to be run. The purpose of this function is mainly to initialize the global variables of the module.
Is calling the function inside mymodule.py
frowned upon? Is it worth it to convert my module into a package and create a __init__.py
file? Or should I just call the initialize()
function from the main file that will import mymodule
?
My question is somehow related to this one but the answers do not satisfy me 100%