I am trying to get a list of attributes from any module, that are contained in a list. My problem really is a syntax problem : I do not know how the python langage is intended to be written in order to solve my problem.
Here is an exemple of the intuitive way I would write it :
import numpy
module = numpy
list_attributes = ['__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__']
for attribute in list_attributes:
print(module.attribute)
Of course, this is not the only application such a syntax could have: I am only presenting the most trivial one to make sure I stay as clear as possible.
Does anyone know how to do what I am trying to do? Or even know if it is feasible in python?
Thank you in advance for any response.