I have a file that has the filename a new line, then the hashvalue of the file then a newline. This pattern repeats. Example:
blah.txt
23847EABF8742
file2.txt
1982834E387FA
I have a class called 'information' that has two member variables.
class information:
filename=''
hashvalue=''
Now I want to read in the file and store a filename and hashvalue in a new instance of an 'information' object and then push the instance of the information object onto a list.
The problem I am having is iterating over the file to read it. I want to read it line by line until the end of file. The problem with python's 'for line in file' method is that it grabs a line each time and I would be forced to do some kind of every other tactic to put the data in the correct member variable.
Instead, this is what I am trying to do...
list=[]
while(not end of file)
x = information()
x.filename = file.readline()
x.hashvalue = file.readline()
list.append(x)