1#!/usr/bin/env python 2""" turtle-example-suite: 3 4 tdemo_peace.py 5 6A simple drawing suitable as a beginner's 7programming example. Aside from the 8peacecolors assignment and the for loop, 9it only uses turtle commands. 10""" 11 12from turtle import * 13 14def main(): 15 peacecolors = ("red3", "orange", "yellow", 16 "seagreen4", "orchid4", 17 "royalblue1", "dodgerblue4") 18 19 reset() 20 Screen() 21 up() 22 goto(-320,-195) 23 width(70) 24 25 for pcolor in peacecolors: 26 color(pcolor) 27 down() 28 forward(640) 29 up() 30 backward(640) 31 left(90) 32 forward(66) 33 right(90) 34 35 width(25) 36 color("white") 37 goto(0,-170) 38 down() 39 40 circle(170) 41 left(90) 42 forward(340) 43 up() 44 left(180) 45 forward(170) 46 right(45) 47 down() 48 forward(170) 49 up() 50 backward(170) 51 left(90) 52 down() 53 forward(170) 54 up() 55 56 goto(0,300) # vanish if hideturtle() is not available ;-) 57 return "Done!" 58 59if __name__ == "__main__": 60 main() 61 mainloop() 62