From fc2324911af4131d51402a6a1f604ca89f09f800 Mon Sep 17 00:00:00 2001 From: Baraa Hamodi Date: Sun, 19 Jul 2015 22:59:34 -0700 Subject: [PATCH] Fixed empty new lines on Windows machines. --- setup.py | 2 +- src/main.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 741587c..ce5eced 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='facebook-online-friend-tracker', - version='1.2.1', + version='1.2.2', description='This tool tracks the number of online friends a user has on Facebook at any given time.', long_description=open('README.rst').read(), url='https://github.com/bhamodi/facebook-online-friend-tracker', diff --git a/src/main.py b/src/main.py index aaa4486..f21d954 100644 --- a/src/main.py +++ b/src/main.py @@ -30,7 +30,7 @@ def main(): print('[WARNING] ' + path_to_csv_file + ' does not exist. Creating a new CSV file now...') path_to_csv_file = os.path.join(os.getcwd(), 'facebook_online_friend_tracker_data.csv') with open(path_to_csv_file, 'w') as f: - writer = csv.writer(f) + writer = csv.writer(f, lineterminator='\n') writer.writerow(['Timestamp', 'Number of Online Friends']) print('New CSV file created at: ' + path_to_csv_file) @@ -83,6 +83,6 @@ def main(): # Append row to the CSV file with open(path_to_csv_file, 'a') as f: - writer = csv.writer(f) + writer = csv.writer(f, lineterminator='\n') writer.writerow([today, onlineFriendsCount]) print('Added: ' + today + ' -> ' + str(onlineFriendsCount) + ' to the spreadsheet.')