annotate docs/pycon2010/graph.py @ 344:4300ef912f4a

graph'
author catherine@Drou
date Tue, 16 Feb 2010 14:05:25 -0500
parents
children 8a5bc9f5c28e
rev   line source
344
catherine@Drou
parents:
diff changeset
1 from turtle import *
catherine@Drou
parents:
diff changeset
2 pu()
catherine@Drou
parents:
diff changeset
3 goto(-400,-400)
catherine@Drou
parents:
diff changeset
4
catherine@Drou
parents:
diff changeset
5 def label(txt):
catherine@Drou
parents:
diff changeset
6 write(txt, font=('Arial', 20, 'italic'))
catherine@Drou
parents:
diff changeset
7
catherine@Drou
parents:
diff changeset
8 def line(len, _label):
catherine@Drou
parents:
diff changeset
9 start = pos()
catherine@Drou
parents:
diff changeset
10 pd()
catherine@Drou
parents:
diff changeset
11 forward(len)
catherine@Drou
parents:
diff changeset
12 pu()
catherine@Drou
parents:
diff changeset
13 forward(30)
catherine@Drou
parents:
diff changeset
14 pd()
catherine@Drou
parents:
diff changeset
15 label(_label)
catherine@Drou
parents:
diff changeset
16 pu()
catherine@Drou
parents:
diff changeset
17 goto(start)
catherine@Drou
parents:
diff changeset
18
catherine@Drou
parents:
diff changeset
19 def tech(x, y, _label):
catherine@Drou
parents:
diff changeset
20 pu()
catherine@Drou
parents:
diff changeset
21 goto(x, y)
catherine@Drou
parents:
diff changeset
22 pd()
catherine@Drou
parents:
diff changeset
23 write(_label, font=('Arial', 40, 'bold'))
catherine@Drou
parents:
diff changeset
24 pu()
catherine@Drou
parents:
diff changeset
25
catherine@Drou
parents:
diff changeset
26 line(600, "Easy to write")
catherine@Drou
parents:
diff changeset
27 left(90)
catherine@Drou
parents:
diff changeset
28 line(600, "Easy to use")
catherine@Drou
parents:
diff changeset
29
catherine@Drou
parents:
diff changeset
30 tech(-360, 160, 'GUI')
catherine@Drou
parents:
diff changeset
31 tech(-390, 100, 'AJAX')
catherine@Drou
parents:
diff changeset
32 tech(-300, -10, 'webapp')
catherine@Drou
parents:
diff changeset
33 tech(190, -380, 'CLU')
catherine@Drou
parents:
diff changeset
34 tech(90, -320, 'TUI')
catherine@Drou
parents:
diff changeset
35 tech(100, -210, 'cmd')
catherine@Drou
parents:
diff changeset
36 tech(80, -100, 'cmd2')
catherine@Drou
parents:
diff changeset
37
catherine@Drou
parents:
diff changeset
38 while True:
catherine@Drou
parents:
diff changeset
39 pass