Python 練習(xí)實例56
python 練習(xí)實例56
題目:畫圖,學(xué)用circle畫圓形?! ?/p>
程序分析:無。
程序源代碼:
實例(python 2.0+):
#!/usr/bin/python # -*- coding: utf-8 -*- if __name__ == '__main__': from tkinter import * canvas = canvas(width=800, height=600, bg='yellow') canvas.pack(expand=yes, fill=both) k = 1 j = 1 for i in range(0,26): canvas.create_oval(310 - k,250 - k,310 + k,250 + k, width=1) k += j j += 0.3 mainloop()
以上實例輸出結(jié)果為:
