commit 3f7a92bd86e73d26ef989d095442a5a2249d0daa Author: Karsten Loesing karsten.loesing@gmx.net Date: Thu Nov 8 09:56:35 2012 -0500
Parse files while reading them from disk.
Suggested by atagar. --- task-6471/python/pygeodate.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/task-6471/python/pygeodate.py b/task-6471/python/pygeodate.py index f9525f0..34ee7da 100644 --- a/task-6471/python/pygeodate.py +++ b/task-6471/python/pygeodate.py @@ -41,7 +41,7 @@ class Database:
def load_combined_databases(self, path): with open(path) as input_file: - for line in input_file.readlines(): + for line in input_file: line = line.strip() if line.startswith('!'): date = line.split("!")[1] @@ -86,7 +86,7 @@ if __name__ == "__main__": db = Database() db.load_combined_databases('geoip-2007-10-2012-09.csv') with open('test-cases-2007-10-2012-09.csv') as input_file: - for line in input_file.readlines(): + for line in input_file: line = line.strip() parts = line.split(',') address_string = parts[0]