|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转新大榭论坛!
您需要 登录 才可以下载或查看,没有账号?注册
x
题目:画椭圆。
7 {) W5 `, ]6 r0 H8 Y3 c p9 |( d程序分析:使用 tkinter。! ~' f5 g! p2 _7 ^
- if __name__ == '__main__':
: J" R! Q! p2 Z5 _' Q1 \/ L' J, R - from tkinter import *" O; `9 f5 x! M% ]" z* ~
- x = 360
+ u- M# r$ H; W - y = 160" h i; P0 O$ ? g6 u
- top = y - 30. X- y- v- Z6 d5 [
- bottom = y - 307 G. l6 W/ i3 `$ L( C
- 8 _+ c, h" O7 l; S3 A
- canvas = Canvas(width = 400,height = 600,bg = 'white')
1 d$ M2 L' E5 a" S9 Y1 h! s - for i in range(20):! `, A; b4 M# T$ b
- canvas.create_oval(250 - top,250 - bottom,250 + top,250 + bottom)
, @' r% D5 g1 L1 h( [ - top -= 5: O- l. b" s" R- |# q7 j
- bottom += 5. Q1 G- I- Y- F/ z
- canvas.pack()5 v' _( l( u% H
- mainloop()
复制代码 |
|