Ai
1 Star 2 Fork 2

Yonja/python100

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
python58.py 623 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhangweizhi 提交于 2016-06-04 15:16 +08:00 . the 100 theme
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
题目:画图,学用rectangle画方形。   
程序分析:
rectangle(int left, int top, int right, int bottom)
参数说明:(left ,top )为矩形的左上坐标,(right,bottom)
为矩形的右下坐标,两者可确定一个矩形的大小
"""
if __name__ == '__main__':
from Tkinter import *
root = Tk()
root.title('Canvas')
canvas = Canvas(root,width=400,height=400,bg='yellow')
x0 = 263
y0 = 263
y1 = 275
x1 = 275
for i in range(10):
canvas.create_rectangle(x0,y0,x1,y1)
x0 -= 5
y0 -= 5
x1 += 5
y1 += 5
canvas.pack()
root.mainloop()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yonja/python100.git
git@gitee.com:yonja/python100.git
yonja
python100
python100
master

搜索帮助