LoginSignup
0
2

More than 3 years have passed since last update.

PythonGUIによる簡易営業ツール作成:原価率計算

Posted at

PythonGUIによる簡易営業ツール作成:原価率計算

仕入金額(仕切金額)と販売金額(納入金額)を入力して、原価率を自動で計算します。
原価率を1から引くと利益率になります。

import tkinter as tk
root=tk.Tk()
root.geometry('300x200')
root.title('マージン')
def btn_click():
    x=float(txt_1.get())
    y=float(txt_2.get())
    z=txt_3.insert(0,x/y)
lbl_1 = tk.Label(text='仕切')
lbl_1.place(x=30, y=70)
lbl_2 = tk.Label(text='納入')
lbl_2.place(x=30, y=100)
lbl_3 = tk.Label(text='原価率')
lbl_3.place(x=30, y=130)
txt_1 = tk.Entry(width=20)
txt_1.place(x=90, y=70)
txt_2 = tk.Entry(width=20)
txt_2.place(x=90, y=100)
txt_3 = tk.Entry(width=20)
txt_3.place(x=90, y=130)
btn = tk.Button(root, text='実行', command=btn_click)
btn.place(x=140, y=170)
root.mainloop()
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2