d = shelve.open('test123.db')
d['1'] = '1'
d['2'] = {}
d['2'][2] = 2
d.close()
d = shelve.open('test123.db')
print(d['1'], d['2'])
d.close()
1 {}
d = PersistDict('test123.db')
d['1'] = '1'
d['2'] = {}
d['2'][2] = 2
d.close()
d = PersistDict('test123.db')
print(d['1'], d['2'])
d.close()
1 {2: 2}
Рисование пока бесплатное.