Python_week#4_quiz4b_question7
来源:互联网 发布:阿里云 时间服务器 编辑:程序博客网 时间:2024/05/21 03:21
import simplegui
pos_x = 10
pos_y = 20
vol_x = 3
vol_y = 0.7
def keydown(key):
global pos_x, pos_y
if key == simplegui.KEY_MAP[“up”]:
pos_x += vol_x
pos_y += vol_y
def draw(canvas):
canvas.draw_line([50,50],[180,50],2,”red”)
canvas.draw_line([180,50],[180,140],2,”red”)
canvas.draw_line([180,140],[50,140],2,”red”)
canvas.draw_line([50,140],[50,50],2,”red”)
canvas.draw_circle((pos_x,pos_y),2,2,”White”)
frame = simplegui.create_frame(“test”,200,200)
frame.set_draw_handler(draw)
frame.set_keydown_handler(keydown)
frame.start()
0 0
- Python_week#4_quiz4b_question7
- Python_week#4_quiz4b_question9
- 4
- 4
- (4)
- 4
- 4
- 4
- 4
- 4
- 4
- 4
- 4
- 4
- 4
- 4
- 4
- 4
- ELK
- bat显示时间
- Reaction of travel book-ShanXi
- complie and run nginx on ubuntu
- 网页抓取,模拟登陆,抓取动态网页内容等过程中,所涉及的Headers信息,Cookie信息,POST数据的处理逻辑
- Python_week#4_quiz4b_question7
- 读书笔记之_weak修饰词
- ASCII ,Unicode ,UTF-8
- <Core Java Volume I Fundamentals 9th Edition> Note 01
- OSGI传统注册式服务与声明式服务
- 九度OJ 1013 开门人和关门人
- Jboss rules规则引擎 Drools 6.4.0 Final 教程(4)
- 大型网站架构演化
- HDU2015 偶数求和