this is our pylist class it holds list of our graphics commands class pylistdef __init__(self)self items [ def append(self,item)self items self items [item if we want to iterate over this sequencewe define the special method called __iter__(selfwithout this we'll get "builtins typeerror'pylistobject is not iterableif we try to write for cmd in seqwhere seq is one of these sequences the yield below will yield an element of the sequence and will suspend the execution of the for loop in the method below until the next element is needed the ability to yield each element of the sequence as needed is called "lazyevaluation and is very powerful it means that we only need to provide access to as many of elements of the sequence as are necessary and no more def __iter__(self)for in self itemsyield def main()filename input("please enter drawing filename" turtle turtle(screen getscreen(file open(filename" " create pylist to hold the graphics commands that are read from the file graphicscommands pylist( command file readline(strip( while command !"" now we must read the rest of the record and then process it because records are variable lengthwe'll use an if-elif to determine which type of record it is and then we'll read and process the record in this programprocessing the record means creating command object using one of the classes above and then adding that object to our graphicscommands pylist object if command ="goto" float(file readline() float(file readline()width float(file readline()color file readline(strip(cmd gotocommand( , ,width,color elif command ="circle"radius float(file readline()width float(file readline()color file readline(strip(cmd circlecommand(radius,width,color elif command ="beginfill"color file readline(strip(this copy belongs to 'acha