I've a Python script which exports a list with tab delimiter (\t) and I'm using same Python script on Mac, Windows and Linux but on Mac it creates an export file with "^M^I" chars instead of just "^I" (this M-notation can be seen on cat -te file.txt
) and it adds newline before tab.
What can be wrong with my code here?
I write lines to file with this snippet
with open(linksFile, "w") as file:
for link in link_list:
file.write(link['from'] + '\t' + link['url'] + '\n')