Normally when I open a CSV file in Python, I need to use:
with open(filename, newline='', mode='w') as f:
And if I don't have that newline='' in there, it creates an empty line between each line in my CSV. However, I am using Tkinter to save the file, so I have:
new_filename = asksaveasfile(mode='w', defaultextension='.csv')
Since "new_filename" is already open, I can't do the "open" command to indicate the newline='' in there. If I try opening it again, I get an error. So how do I get rid of the extra spaces in this case?
Thanks for your help and patience.