comparison docs/pycon2010/schematic.py @ 351:8a5bc9f5c28e

cmd2 docs
author catherine@Drou
date Tue, 16 Feb 2010 23:07:04 -0500
parents
children
comparison
equal deleted inserted replaced
350:1c91655d05f8 351:8a5bc9f5c28e
1 from turtle import *
2 hideturtle()
3 width(6)
4 pensize = 10
5 pu()
6 goto(0,-400)
7
8 def rectangle(x, y, _label):
9 pu()
10 seth(0)
11 backward(x / 2)
12 fontsize = 40
13 pd()
14 for i in range(2):
15 forward(x)
16 left(90)
17 forward(y)
18 left(90)
19 pu()
20 forward(x / 2)
21 left(90)
22 forward(y / 2 - fontsize)
23 pd()
24 write(_label, align='center', font=('Arial', fontsize, 'bold'))
25
26 rectangle(800, 80, 'cmd')
27 pu()
28 forward(80)
29 rectangle(200, 400, 'cmd2')
30
31 while True:
32 pass