Hi guys, I am fairly new to python. The problem I am having is manipulating the data that I read from a file. Example: if a line of the file is Monday = 0800, is it possible to break up that line so I can read Monday and 0800 separately and do whatever manipulation to that specific text.
The other problem I am having is if I read a line from a file ex: foo and I want to test if the readline() method has read that line ex:
f = open('file.txt')
line = f.readline()
while(True):
if line == 'foo':
print 'read line foo'
When i attempt the code above python reads the line foo but it doesn't execute the print statement. There could be something that is very easy that I am missing. Any help is appreciated! Thanks!