Let\'s assume I have the following file structure:
data.py
foo = [] bar = [] abc = \"def\"
core.py
I have to make a dictionary of these variables. I used this code.
print({item:getattr(my_module, item) for item in dir(my_module) if not item.startswith("__") and not item.endswith("__")})