I use the following code segment to read a file in python:
with open (\"data.txt\", \"r\") as myfile: data=myfile.readlines()
Input fil
f = open('data.txt','r') string = "" while 1: line = f.readline() if not line:break string += line f.close() print string