class PlayList: def _process(self,file): for line in file.readlines(): if line.startswith("Title"): self.data.append(line[line.find('=')+1:]) def __init__(self,location): file = open(location,'r') self.data = [] self._process(file) file.close self.length = len(self.data) pls = PlayList('c:/pls2.txt') for entry in pls.data: print entry print '--'