I need a help adding a simple solution to my problem. In writer for csv
with open(os.path.join(self.current_dir, csv_filename), 'w') as f:
writer = csv.writer(f)
writer.writerows(rows)
I CAN'T add newline='' because it causes some bugs in logic, and totally mess up my results. Soo i came up to solution, but unfortunately i dont know Python very well. Is there any way to write a loop that will remove ALL empty rows from csv file after it has been written ? It is for Python 3.4
EDIT:
As people pointed out, newline and using binary writing is the way to go for this problem in windows, but my real question is, can a loop that removes empty rows from csv file be implemented in same script or does it need a seperate script that does the removing ? Either way will work for me.