[Tutor] Dictionary from a text file

Nitish Kunder ndk1991 at gmail.com
Thu Oct 31 07:16:11 CET 2013


I have a dictionary which is in this format
for ex:

{
'5x' : {
'50' : {
'update' : {
'update-from-esxi5.0-5.0_update01' : {
'call' : Update,
'name' : 'Update50u1',
'release' : '15/03/12'
},
'update-from-esxi5.0-5.0_update02' : {
'call' : Update,
'name' : 'Update50u2',
'release' : '21/12/12'
},
},
 'patch' : {
'ESXi500-201109001' : {
'call' : Patch,
'name' :'Patch_501',
'release' : '13/09/11'
},
'ESXi500-201111001' : {
'call' : Patch,
'name' :'ExpressPatch501',
'release' : '13/09/11'
},
 },
},
 '51' : {
'update' : {
'update-from-esxi5.1-5.1_update01' : {
'call' : Update,
'name' : 'Update51u1',
'release' : '25/04/13'
},
},
'patch' : {
'ESXi510-201210001' : {
'call' : Patch,
'name' :'ExpressPatch511',
'release' : '29/08/13'
},
'ESXi510-201212001' : {
'call' : Patch,
'name' :'Patch_511',
'release' : '20/12/12'
},
 },
},
},
 }

Note: in* 'call' : Update* ,Update it is a function defined in my python
script. My dictionary is too large so i taught rather than using directly
in python program I save it in a text file and when needed i assign it to
dictionary object . How can i assign this text file to dictionary object
and call it?

Thanks for you help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131031/d547a86d/attachment.html>


More information about the Tutor mailing list