file_size = os.path.getsize('some/file.txt') with open('some/file.txt') as stream: for line in stream: # some parsing algorithm
file_size = os.path.getsize('some/file.txt') with open('some/file.txt') as stream: for line in stream: # some parsing algorithm
class Progressor: def __init__(self, overall): self.overall = overall self.utilized = 0 def progress(self, amount) self.utilized += amount return float(self.utilized) / self.overall