♠ 다음과 같이 농구장을 그려보세요.

파이썬 거북이 - 농구장 그리기

 

from tkinter import *
w = Tk()
w.title("농구장")
w.geometry("700x400")
w.resizable(True, True)

l_frame=Frame(w, relief="solid", bg="blue", bd=2)
l_frame.pack(side="left",fill="both",expand=True)

r_frame=Frame(w, relief="solid", bg="light blue", bd=2)
r_frame.pack(side="right",fill="both",expand=True)

canvas = Canvas(l_frame, width=350, height=400, bg="blue", bd=2)
canvas.pack()

canvas.create_line(0, 150,200, 190)
canvas.create_line(0, 250,200, 220)
canvas.create_oval(180, 180,230, 230, fill="pink")

canvas.create_oval(300, 160,400, 250, fill="red")

canvas = Canvas(r_frame, width=350, height=400, bg="light blue")
canvas.pack()

canvas.create_oval(-60, 160,50, 250, fill="red")

canvas.create_line(400, 150,150, 190)
canvas.create_line(400, 280,150, 220)

canvas.create_oval(120, 180,170, 230, fill="yellow")

w.mainloop()
Posted by 명문코딩컴퓨터
,