I have a need to add module attributes at run time. For example, when a module is loaded, it reads the file where the data is contained. I would like that data to be avail
If you don't know the attribute name until runtime, use setattr:
setattr
>>> import mymodule >>> setattr(mymodule, 'point', (1.0, 4.0)) >>> mymodule.point (1.0, 4.0)