Найти тему
Табличный Мастер

Калькулятор расчёта длины нити в Python

from tkinter import *

import math

root = Tk()

root.geometry("250x125")

root.title('Калькулятор расчета длины нити')

Label(root, text='Площадь изделия'). grid(row=0, sticky=W)

Label(root, text='Длина нити образца'). grid(row=1, sticky=W)

Label(root, text='Площадь образца'). grid(row=2, sticky=W)

EntryA=Entry(root,width=10,font='Arial 14')

EntryB=Entry(root,width=10,font='Arial 14')

EntryC=Entry(root,width=10,font='Arial 14')

EntryD=Entry(root,width=10,font='Arial 14')

EntryA.grid(row=0,column=1,sticky=W)

EntryB.grid(row=1,column=1,sticky=W)

EntryC.grid(row=2,column=1,sticky=W)

EntryD.grid(row=3,column=1)

def L():

  a =EntryA.get()

  a = float(a)

  b =EntryB.get()

  b = float(b)

  c =EntryC.get()

  c = float(c)

  result = math.ceil((a * b) / c)

  EntryD.delete(0, END)

  EntryD.insert(0, result)

but=Button(root, text='L', command=L,width=10,bg="green")

but.grid(row=4,column=1,sticky=W)

root.mainloop()

Подпишись на канал и поставь лайк!