When I copy one text file to another the new file has the two characters: (??) at the end which I do not want.
I am using Python3.6.0 on Windows7
This is my script:
from sys import argv
script, from_file, to_file = argv
#Open from_file and get the text from it
indata = open(from_file).read()
#Write the from_file text to to_file
open(to_file, 'w').write(indata)
I run the following in PowerShell:
>echo "This is a test file." > TestSource.txt
>type TestSource.txt
This is a test file.
>python CopyFile.py TestSource.txt TestDestination.txt
>type TestDestination.txt
This is a test file.??
Why do two question marks (??) appear in the file I have created?
Edit: This Related Question was suggested as duplicate. My question is about how Python behaves when I copy one text file to another. Where as this related question is about how Windows PowerShell creates a text file.