100-063

画椭圆。
 1 #! /usr/bin/env python
 2 # -*- coding:utf-8 -*-
 3 '''
 4 画椭圆。
 5 '''
 6 if __name__ == '__main__':
 7     from tkinter import *
 8 
 9     x = 360
10     y = 160
11     top = y - 30
12     bottom = y - 30
13 
14     canvas = Canvas(width=400, height=600, bg='white')
15     for i in range(20):
16         canvas.create_oval(250 - top, 250 - bottom, 250 + top, 250 + bottom)
17         top -= 5
18         bottom += 5
19     canvas.pack()
20     mainloop()

 

posted @ 2018-05-27 19:30  睡到自然醒的猪  阅读(56)  评论(0)    收藏  举报

xliaoe at 111 dot com ; 返回顶部