Python tkinter繪圖對比EXCEL

def pv(r,n,m,f):#劉任昌函數參數r,n,m,f
    p = m/r*(1 - 1/(1+r)**n)+f/(1+r)**n
    return p#執行函數的結果傳回去
n=float(input('期數: '))#要計算轉為實數real nubers
m=float(input('收付: '))#浮點點float
f=float(input('終值: '))
for i in range(1,10):#迴圈
   r = i*0.01
   x=pv(r,n,m,f)
   print('利率 ', r ,'價格 ', x)
import tkinter as tk#輸入tkinter繪圖
root = tk.Tk()
root.title('劉老猴python tkinter')
root.geometry('600x600')#寬度width改成600
canvas = tk.Canvas(root, width=600, height=600)  # 加入 Canvas 畫布
canvas.pack()
x, y = 0, 0
canvas.create_line(0, 400, 500, 400, width=5,fill='purple')
canvas.create_line(5, 0, 5, 400, width=5,fill='purple')
for x in range(1, 400):
    x1 = x+1
    y1 = 400 - pv(x1,n,m,f)*400
    canvas.create_line(x, y, x1, y1, width=5,fill='blue')
    canvas.pack()
    x = x1
    y = y1
root.mainloop()

留言

  1. https://lu-chieh-chi.blogspot.com/2025/06/p.html

    回覆刪除
  2. https://allyking097.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  3. https://shanny11336108.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  4. https://yuxi1202.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  5. https://xie-ni.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  6. https://djhdvdhd.blogspot.com/2025/06/blog-post_10.html

    回覆刪除
  7. https://yehjungwen.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  8. https://guovupvmp.blogspot.com/2025/06/def-pvrnmfrnmf-p-mr1-11rnf1rn-return-p.html

    回覆刪除
  9. https://xiyuying.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  10. https://zzy-hn.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  11. https://egdvcn-gh.blogspot.com/2025/06/preborder3px-red-solid-def-pvrnmfrnmf-p.html

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

    回覆刪除
  13. https://chenwewen.blogspot.com/2025/06/pythonexcel-pv.html

    回覆刪除
  14. https://xin00.blogspot.com/2025/06/pythonexcel-pv.html

    回覆刪除
  15. https://jiang-jia-ehen.blogspot.com/2025/06/pythonexcel-pv.html

    回覆刪除
  16. https://linchengxun.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  17. https://syx0304syx.blogspot.com/2025/06/python-tkinterexcel.html

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

    回覆刪除
  19. https://chen-kai01htmlshow210.blogspot.com/2025/06/blog-post.html

    回覆刪除
    回覆
    1. 0611.緊接PRE加上STYLE='BORDER:5PX SOLID RED'
      https://chen-kai01htmlshow210.blogspot.com/2025/06/blog-post.html

      刪除
  20. https://jiang233.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  21. https://spy0928.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  22. https://laichia-jung.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  23. https://yezonghan.blogspot.com/2025/06/python-tkinterexcel.html

    回覆刪除
  24. https://chan0528.blogspot.com/2025/06/javascriptpythonipr.html

    回覆刪除

張貼留言

這個網誌中的熱門文章

柯聞折Javascript物件導向方法是物件的函數

甲劉任昌python串列List(陣列Array),元組Tuple,集合Set,字典Dict

周偉玲Python執行IRR