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