Answers for "python dict to dot notation"

1

python dict dot notation

>>> from types import SimpleNamespace
>>> d = {'key1': 'value1', 'key2': 'value2'}
>>> n = SimpleNamespace(**d)
>>> print(n)
namespace(key1='value1', key2='value2')
>>> n.key2
'value2'
Posted by: Guest on October-13-2020

Code answers related to "python dict to dot notation"

Python Answers by Framework

Browse Popular Code Answers by Language