当前位置:K88软件开发文章中心编程语言PythonPython01 → 文章内容

画椭圆。

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-6 1:23:49

使用 Tkinter。

程序源代码:

实例


#!/usr/bin/python

# -*- coding:
UTF-8 -*-
if __name__ == '__main__':
from Tkinter import *x = 360y = 160top = y - 30bottom = y - 30canvas = Canvas(width = 400,height = 600,bg = 'white')for i in range(20):
canvas.create_oval(250 - top,250 - bottom,250 + top,250 + bottom)top -= 5bottom += 5canvas.pack()mainloop()

以上实例输出结果为:

Python 100例

点我分享笔记

  • 昵称 (必填)
  • 邮箱 (必填)
  • 引用地址
画椭圆。