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

1 Answer

0 votes
l = locals()

print(l)


'''
run:

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

'''

 



answered Dec 13, 2018 by avibootz

Related questions

1 answer 280 views
2 answers 374 views
1 answer 227 views
2 answers 391 views
1 answer 172 views
172 views asked Sep 3, 2021 by avibootz
1 answer 538 views
...