Home:ALL Converter>Why Python script on Mac exports different tab characters?

Why Python script on Mac exports different tab characters?

Ask Time:2019-11-24T21:16:21         Author:she hates me

Json Formatter

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')

Author:she hates me,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/59018033/why-python-script-on-mac-exports-different-tab-characters
yy