Re: writing dictionary to file

2007-03-08 Thread jim-on-linux
On Thursday 08 March 2007 14:40, kavitha thankaian wrote: > Hi Simon, > > iam till here: > > dorc=some['DorC'] > amount=some['amount'] > f=open("logfile.txt", "w") > if dorc =='C': >a = -(amount) > if dorc == 'D': >b = amount >sum=a + b >if sum == 0: >f.writelines

Re: writing dictionary to file

2007-03-08 Thread kavitha thankaian
Hi Simon, iam till here: dorc=some['DorC'] amount=some['amount'] f=open("logfile.txt", "w") if dorc =='C': a = -(amount) if dorc == 'D': b = amount sum=a + b if sum == 0: f.writelines("name:") f.writelines("%s" %some['name']) f.writelines("credit:"

writing dictionary to file

2007-03-08 Thread kavitha thankaian
Hi, I have 'n' number of dictionaries with the same name but different values ( DorC means debit or credit) some={'DorC':'D', 'amount':200,'name':'xxx'} some={'DorC':'C', 'amount':200,'name':'xxx'} some={'DorC':'D', 'amount':300,'name':'yyy'} some={'DorC':'C', 'amount':500,

Re: dictionary to file

2005-09-16 Thread Larry Bates
You don't define what you mean by "a lot". Python can read a tremendous amount of information from files in a very short amount of time so I wouldn't try to prematurely optimize this. Just read the information and see how long it takes. If it is really a long time, then look for alternatives. It

Re: dictionary to file

2005-09-16 Thread Max M
Enrique Palomo Jiménez wrote: > Hi all, > > I'm writing an application who needs to handle a lot of information of > several files. > So, i think the better way is design a batch process to catch that > information in a dictionary and write it in a file. > So, after that when a user wants to ret

dictionary to file

2005-09-16 Thread Enrique Palomo Jiménez
Hi all, I'm writing an application who needs to handle a lot of information of several files. So, i think the better way is design a batch process to catch that information in a dictionary and write it in a file. So, after that when a user wants to retrieve something, only with an execfile i'll