source: python/trunk/Demo/turtle/tdemo_peace.py

Last change on this file was 391, checked in by dmik, 11 years ago

python: Merge vendor 2.7.6 to trunk.

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1#!/usr/bin/env python
2""" turtle-example-suite:
3
4 tdemo_peace.py
5
6A very simple drawing suitable as a beginner's
7programming example.
8
9Uses only commands, which are also available in
10old turtle.py.
11
12Intentionally no variables are used except for the
13colorloop:
14"""
15
16from turtle import *
17
18def main():
19 peacecolors = ("red3", "orange", "yellow",
20 "seagreen4", "orchid4",
21 "royalblue1", "dodgerblue4")
22
23 reset()
24 s = Screen()
25 up()
26 goto(-320,-195)
27 width(70)
28
29 for pcolor in peacecolors:
30 color(pcolor)
31 down()
32 forward(640)
33 up()
34 backward(640)
35 left(90)
36 forward(66)
37 right(90)
38
39 width(25)
40 color("white")
41 goto(0,-170)
42 down()
43
44 circle(170)
45 left(90)
46 forward(340)
47 up()
48 left(180)
49 forward(170)
50 right(45)
51 down()
52 forward(170)
53 up()
54 backward(170)
55 left(90)
56 down()
57 forward(170)
58 up()
59
60 goto(0,300) # vanish if hideturtle() is not available ;-)
61 return "Done!!"
62
63if __name__ == "__main__":
64 main()
65 mainloop()
Note: See TracBrowser for help on using the repository browser.