Simple sales tool creation with Python GUI: Cost rate calculation

Simple sales tool creation with Python GUI: Cost rate calculation

Enter the purchase amount (partition amount) and sales amount (delivery amount) to automatically calculate the cost rate. Subtract the cost rate from 1 to get the profit rate.

import tkinter as tk
root=tk.Tk()
root.geometry('300x200')
root.title('margin')
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='Partition')
lbl_1.place(x=30, y=70)
lbl_2 = tk.Label(text='delivery')
lbl_2.place(x=30, y=100)
lbl_3 = tk.Label(text='Cost rate')
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='Run', command=btn_click)
btn.place(x=140, y=170)
root.mainloop()

Recommended Posts

Simple sales tool creation with Python GUI: Cost rate calculation
Simple sales tool creation with Python GUI: Quote creation
Simple sales tool creation with Python GUI: Desktop application released
Simple sales tool creation using Python GUI: Employee number search (radio button)
GUI image cropping tool made with Python + Tkinter
Numerical calculation with Python
# 1 [python3] Simple calculation using variables
[GUI with Python] PyQt5-Layout management-
Create a simple video analysis tool with python wxpython + openCV
[GUI with Python] PyQt5 -Preparation-
[GUI with Python] PyQt5 -Paint-
[GUI with Python] PyQt5 -Widget II-
Let's make a GUI with python.
[GUI with Python] PyQt5-The first step-
[GUI with Python] PyQt5-Drag and drop-
GUI creation with Pyside2 <Kindergarten level>
Automate simple tasks with Python Part0
[GUI with Python] PyQt5 -Custom Widget-
GUI creation in python using tkinter 2
Automate simple tasks with Python Part1 Scraping
Machine learning with python (2) Simple regression analysis
Create a simple GUI app in Python
Use Amazon Simple Notification Service with Python
1. Statistics learned with Python 1-3. Calculation of various statistics (statistics)
WebApi creation with Python (CRUD creation) For beginners
Excel table creation with Python [Progress management table]
Happy GUI construction with electron and python
I made a simple blackjack with Python