Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #dict #dot #notation
ADD COMMENT
Topic
Name
5+3 =