I created a custom py file that returns your globals() values and lets you delete any imported modules. However since it runs globals() within that function, when I import the module in another py file, it just returns the globals() directory files for the function namespace where it was defined. I hope this makes sense.
Example:
# custom py file: "mod1.py"
def mods():
return( globals() )
# different py file, kernel reset
from mod1 import mods
mods()
So what is happening is that it is running globals() - which returns all the names in the local namespace but that namespace is where the function was define aka: "mod1.py". How can I run it in the 2nd py file?