1 Star 0 Fork 0

dzc/Python-1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Polyline.py 596 Bytes
一键复制 编辑 原始数据 按行查看 历史
Nathan R 提交于 2019-01-20 08:58 +08:00 . Rename Polyline to Polyline.py
# Polyline drawing in codeskulptor
import simplegui
import math
polyline = []
def click(pos):
global polyline
polyline.append(pos)
def clear():
global polyline
polyline = []
def draw(canvas):
if len(polyline) == 1:
canvas.draw_point(polyline[0] , "White")
for i in range(1 ,len(polyline)):
canvas.draw_line(polyline[i-1] ,polyline[i] ,2 ,"White" )
frame = simplegui.create_frame("Echo click", 300, 200)
frame.set_mouseclick_handler(click)
frame.set_draw_handler(draw)
frame.add_button("Clear", clear)
frame.start()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sdredboy/Python-1.git
git@gitee.com:sdredboy/Python-1.git
sdredboy
Python-1
Python-1
master

搜索帮助