def draw():#按下按鈕Button1 for firm in firms: t=(firm, year.get()) x = 10+20*stdev[t]*2*3**0.5 #放大20 y = 500 - 10*mean[t]*12 #放大10 dot=canvas.create_oval(x-5,y-5,x+5,y+5,fill='blue') lab=canvas.create_text(x+10,y,text=firm[4:7],anchor=W,font=('微軟中黑體', 16)) def delete():#按下按鈕Button2執行Delete canvas.delete('all') years=[x for x in range(2007, 2025)] year=IntVar(tk) year.set(years[-1]) label = Label(tk, text="年度",font=('Arial',30,'bold'),).pack(side=LEFT) #距離左側 option1 = OptionMenu(tk, year, *years).pack(side=LEFT) button1 = Button(tk, text="許家豪繪圖 ",font=('Arial',20,'bold'), command = draw, bg='#5599FF',fg='white').pack(side=LEFT) button2 = Button(tk, text="許家豪刪除 ",font=('Arial',20,'bold'), command = delete, bg='#5599FF',fg='white').pack(side=LEFT) tk.mainloop() #label button1 button2都改變字體
期末作業https://hsuchiahaoprogramming.blogspot.com/2025/06/d11117111.html
回覆刪除程式交易期末考.https://hsuchiahaoprogramming.blogspot.com/2025/06/60.html
程式交易期中考https://hsuchiahaoprogramming.blogspot.com/2025/04/pythoncsv.html