# This program reads from a file called cities.txt which contains the (x, y) # coordinates of US cities with a popluation of 500 or more. It draws a # 1x1 rectangle (a single pixel) for each city. from drawingpanel import * panel = DrawingPanel(500, 300) for line in file("cities.txt"): parts = line.split() x = int(round(float(parts[0]))) y = int(round(float(parts[1]))) panel.canvas.create_rectangle(x, y, x, y) panel.mainloop()