I have a simple code over here that should output 2 columns of characters in a text file.
infile = open('anything.txt', 'r')
outfile = open('some.txt', 'w')
f = infile.readlines()
data=[]
a=['1','2','3']
b=['5','6','7']
for i in a:
for j in b:
outfile.write(i + "\t" + j + "\n")
What I got when I open the resultant text file with the standard Notepad are these strange characters! ऱਵऱਸ਼ऱलਵलਸ਼लळਵळਸ਼ळ
However, when I opened the text file with Notepad++ or Wordpad, the result is two columns of numbers with a tab between them, as what we expected.
I am really lost here. What is going on ? Can't I open the text file with a standard Notepad?
Thanks for your help.