How to get the global symbol table as a dictionary in Python

1 Answer

0 votes
gl = globals()

print(gl)


'''
run:

{'__name__': '__main__', '__builtins__': <module 'builtins' (built-in)>, 'gl': {...},
 '__doc__': None, '__package__': None, '__cached__': None, '__file__': 'C:/python/test.py',
 '__spec__': None,
 '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x00415A10>}

'''

 



answered Dec 12, 2018 by avibootz

Related questions

1 answer 276 views
2 answers 369 views
1 answer 223 views
2 answers 386 views
1 answer 169 views
169 views asked Sep 3, 2021 by avibootz
1 answer 535 views
...