I use the following code segment to read a file in python:
with open (\"data.txt\", \"r\") as myfile: data=myfile.readlines()
Input fil
Try the following:
with open('data.txt', 'r') as myfile: data = myfile.read() sentences = data.split('\\n') for sentence in sentences: print(sentence)
Caution: It does not remove the \n. It is just for viewing the text as if there were no \n
\n