What I'm trying to do would look like this in the command line:
>>> import mymodule
>>> names = dir(mymodule)
How can I get a reference to all the names defined in mymodule
from within mymodule
itself?
Something like this:
# mymodule.py
names = dir(__thismodule__)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…