賴青得python運算CSV輸出TKINTER投資風險與報酬Markowitz

期末考60分部分一定要給老師看

關鍵程式碼

def draw():#按下按鈕button1執行draw
    canvas.create_line(0,500,700,500,width=3,fill='black',arrow='last')
    canvas.create_line(10,600,10,5,width=3,fill='black',arrow='last')
    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[0])
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',30,'bold'), command = draw, bg='black',fg='white').pack(side=LEFT)
button2 = Button(tk, text="賴青德刪除 ",font=('Arial',30,'bold'), command = delete, bg='black',fg='white').pack(side=LEFT)
tk.mainloop()
#label button1 button2都改變字體

留言

  1. https://python-wopoyan.blogspot.com/2025/06/60.html

    回覆刪除
  2. 作者已經移除這則留言。

    回覆刪除
  3. https://o3og413.blogspot.com/2025/06/60.html

    回覆刪除
  4. https://cynthiachen59.blogspot.com/2025/06/blog-post.html

    回覆刪除
  5. https://d11117312d.blogspot.com/2025/06/60.html

    回覆刪除
  6. https://hsuchiahaoprogramming.blogspot.com/2025/06/60.html

    回覆刪除
  7. https://d11117102.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  8. https://www.blogger.com/blog/post/edit/2791372774619134155/1375841039393601752

    回覆刪除
    回覆
    1. 只有一篇沒有影片。https://zitiance.blogspot.com/2025/06/blog-post_19.html

      刪除
  9. 作者已經移除這則留言。

    回覆刪除
  10. https://meishiuanlin.blogspot.com/2025/06/python-tkinter.html

    回覆刪除
  11. https://mandytakming.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  12. https://d11117220takminggh.blogspot.com/2025/06/pythoncsvtkintermarkowitz-6-19-2025.html

    回覆刪除
  13. https://linpeiyud11117127.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  14. https://takmingd11117330.blogspot.com/2025/06/pythoncsvthinkermarkowitz.html

    回覆刪除
  15. https://sususu0123.blogspot.com/2025/06/60-def-drawbutton1draw-canvas.html

    回覆刪除
  16. https://hsuppppp.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  17. https://howard930621.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  18. https://takmingd11117329.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  19. https://gary20010101.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  20. https://d11112215.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  21. https://python-spencer.blogspot.com/2025/06/083pythoncsvtkintermarkowitz.html

    回覆刪除
  22. https://d1111735.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  23. https://.blogspot.com/2025/06/d111712860.html

    回覆刪除
  24. https://d11150108.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  25. https://rivkydf.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  26. https://www.blogger.com/blog/post/edit/preview/2897209240624336373/4628244215807983538

    回覆刪除
  27. 作者已經移除這則留言。

    回覆刪除
  28. https://chenjiayu.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  29. https://jennysuwanting.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  30. https://tinggggggggggg.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  31. https://ktglgfk.blogspot.com/2025/06/pythoncsvtkintermarkowitz.html

    回覆刪除
  32. https://www.peopo.org/news/701149

    回覆刪除
  33. 沒改成自己的名字啊https://erichtml-css-javascript-java.blogspot.com/2025/06/60.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

馬可維茲風險平均數平面

劉任昌利用Python讀取SPY日成交資料(繳交作業情形)