# File: ChapterIOFiles/readFile.py # Reads a text file and prints it on the canvas. from graphics import * def main(): win = GraphWin("Readme",300,300) fin = open("Texts/readme.txt", 'r') #opens file stream object for reading text = fin.readlines() #list of strings will contain all the file fin.close() print(text) # just to check x,y = 150,50 # starting points step = 20 # space between lines for i in range(len(text)): Text(Point(x,i*step + y),text[i]).draw(win) main()