Commit dcf9c967 by Sanjay Krishnan

updated with class files

parent 59c34038
This source diff could not be displayed because it is too large. You can view the blob instead.
class Load:
"""Loads a large file into the
program line-by-line"""
def __init__(self, filename):
self.filename = filename
def __iter__(self):
self.file = open(self.filename, 'r')
self.line = self.file.readline()
return self
def __next__(self):
if self.line != "":
result = self.line
self.line = self.file.readline()
return int(result)
else:
raise StopIteration
def Flush(it, filename):
file = open(filename, 'w')
for i in it:
file.write(str(i)+'\n')
file.close()
def Size(filename):
import os
return os.path.getsize(filename)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment