I really don't see what is wrong =(.
First I download via curl a file, then I want to compare it to a local file
there are 15 lines in dwnext.ded
and there are 14 lines in extlib.ded
I want to store in append those lines that have a string before the "|" that is not in a line in the local file
In content i just want to store all the local lines again
like you can see I added two times:
print line when I run the script I get 14 times the first line of dwnext.ded and then the other 14 lines all once.
Also append contains all lines from dwnext instead of the lines that were not found on the local :(
(I hope my summary is clear enough :p)
P.S.: I do not get errors
os.system("curl http://d-cm.googlecode.com/files/extlib.ded -o "+self.dcmdir+"/DOPEN/dwnext.ded") append="" content="" x="n" g=open(self.dcmdir+"/DOPEN/extlib.ded",'r') f=open(self.dcmdir+"/DOPEN/dwnext.ded",'r') for line in f.readlines(): for ln in g.readlines(): if line.strip().split("|") == ln.strip().split("|"): x="y" content=content+ln print line if x!="y": print line append=append+line x="n" f.close() g.close()