python programming reading and processing multi-line records import turtle def main()filename input("please enter drawing filename" turtle turtle(screen getscreen( file open(filename" " here we have the half loop to get things started reading our first graphics command here lets us determine if the file is empty or not command file readline(strip( if the command is emptythen there are no more commands left in the file 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 if command ="goto" float(file readline() float(file readline()width float(file readline()color file readline(strip( width(widtht pencolor(colort goto( ,yelif command ="circle"radius float(file readline()width float(file readline()color file readline(strip( width(widtht pencolor(colort circle(radiuselif command ="beginfill"color file readline(strip( fillcolor(colort begin_fill(elif command ="endfill" end_fill(elif command ="penup" penup(elif command ="pendown" pendown(elseprint("unknown command found in file:",command this is still inside the while loop we must (attempt toread the next command from the file if the read succeedsthen command will not be the empty string and the loop will be repeated if command is empty it is because there were no more commands in the file and the while loop will terminate command file readline(strip( this copy belongs to 'acha