Python 练习实例56

Python 练习实例56 Python 100例

题目:画图,学用circle画圆形。   

程序分析:无。

程序源代码:

实例(Python 2.0+)

#!/usr/bin/python# -*- coding: UTF-8 -*-if__name__ == '__main__': fromTkinterimport * canvas = Canvas(width=800, height=600, bg='yellow')canvas.pack(expand=YES, fill=BOTH)k = 1j = 1foriinrange(0,26): canvas.create_oval(310 - k,250 - k,310 + k,250 + k, width=1)k += jj += 0.3mainloop()

以上实例输出结果为:

Python 练习实例56

Python 练习实例56 Python 100例