Hi,
I would like to write the dictionary data to the file.
The following stuff I am doing :
I tried to get the size of the dictionary ( count = sampleDict.size ),but it is giving error,so I am using list in between.
The out put should be
100 1 2 3
200 4 5 6
300 7 8 9
Could anybody help me in getting this output.
Thanks in advance
-PSB
I would like to write the dictionary data to the file.
The following stuff I am doing :
Code:
sampleDict = { 100:[1,2,3],200:[4.5,6], 300:[7,8,9]}
list1 = sampleDict.keys()
sf = open("C:\\TestFiles\\Sample.txt",'w')
for i in range( 0, list1.__len__()):
f.write(sampleDict t[i])
f.write('\n')
f.close()
The out put should be
100 1 2 3
200 4 5 6
300 7 8 9
Could anybody help me in getting this output.
Thanks in advance
-PSB
Comment