I use the following code segment to read a file in python:
with open (\"data.txt\", \"r\") as myfile: data=myfile.readlines()
Input fil
Have you tried this?
x = "yourfilename.txt" y = open(x, 'r').read() print(y)