When I try to run this code
"""Hello World"""
print globals()[__doc__]
Why do I get this error ?
Traceback (most recent call last):
File "D:\myProjects\python\Python-13.py", line 3, in <module>
print globals()[__doc__]
KeyError: 'Hello World'
Context : I just want the doc string of current module
You need
print globals()['__doc__'].