Created
April 25, 2021 19:27
-
-
Save rupython/c267af4a0b1c2be39ca8865ad879ae15 to your computer and use it in GitHub Desktop.
From: 🦔
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Добрый вечер, не подскажете почему здесь ругается на четвёртую строку, спасибо! | |
import tkinter as tk | |
def plus(): | |
x = ( int(a.get()) * int(a1.get()) ) + ( int(b.get()) * int(b1.get()) ) + ( int(c.get()) * int(c1.get() ) + ( int(d.get() * int(d1.get()) ) + ( int(e.get()) * int(e1.get()) ) + ( int(f.get()) * int(f1.get()) ) + ( int(g.get()) * int(g1.get()) ) + ( int(h.get()) * int(h1.get()) ) | |
result.insert(0, str(x)) | |
def delet(): | |
result.delete(0, 'end') | |
bone = tk.Tk() | |
bone.geometry('320x325') | |
bone.title('Считалка') | |
lab = tk.Label(bone, text = 'Считаем сумму!') | |
lab.pack() | |
lab1 = tk.Label(bone, text = 'Цена') | |
lab1.place(x = 120, y = 45) | |
lab2 = tk.Label(bone, text = 'Количество') | |
lab2.place(x = 215, y = 45) | |
# Пункты | |
lab3 = tk.Label(bone, text = 'CPU') | |
lab3.place(x = 5, y = 65) | |
lab4 = tk.Label(bone, text = 'MOTHERBOARD') | |
lab4.place(x = 5, y = 90) | |
lab5 = tk.Label(bone, text = 'CULLER') | |
lab5.place(x = 5, y = 115) | |
lab6 = tk.Label(bone, text = 'RAM') | |
lab6.place(x = 5, y = 140) | |
lab7 = tk.Label(bone, text = 'GPU') | |
lab7.place(x = 5, y = 165) | |
lab8 = tk.Label(bone, text = 'SSD') | |
lab8.place(x = 5, y = 190) | |
lab9 = tk.Label(bone, text = 'CASE') | |
lab9.place(x = 5, y = 215) | |
lab10 = tk.Label(bone, text = 'POWER') | |
lab10.place(x = 5, y = 240) | |
# Цены | |
a = tk.Entry(bone, width = 10) | |
a.place(x = 120, y = 65) | |
b = tk.Entry(bone, width = 10) | |
b.place(x = 120, y = 90) | |
c = tk.Entry(bone, width = 10) | |
c.place(x = 120, y = 115) | |
d = tk.Entry(bone, width = 10) | |
d.place(x = 120, y = 140) | |
e = tk.Entry(bone, width = 10) | |
e.place(x = 120, y = 165) | |
f = tk.Entry(bone, width = 10) | |
f.place(x = 120, y = 190) | |
g = tk.Entry(bone, width = 10) | |
g.place(x = 120, y = 215) | |
h = tk.Entry(bone, width = 10) | |
h.place(x = 120, y = 240) | |
# Количество | |
a1 = tk.Entry(bone, width = 10) | |
a1.place(x = 215, y = 65) | |
b1 = tk.Entry(bone, width = 10) | |
b1.place(x = 215, y = 90) | |
c1 = tk.Entry(bone, width = 10) | |
c1.place(x = 215, y = 115) | |
d1 = tk.Entry(bone, width = 10) | |
d1.place(x = 215, y = 140) | |
e1 = tk.Entry(bone, width = 10) | |
e1.place(x = 215, y = 165) | |
f1 = tk.Entry(bone, width = 10) | |
f1.place(x = 215, y = 190) | |
g1 = tk.Entry(bone, width = 10) | |
g1.place(x = 215, y = 215) | |
h1 = tk.Entry(bone, width = 10) | |
h1.place(x = 215, y = 240) | |
# Результат | |
lab11 = tk.Label(bone, text = 'Итог:') | |
lab11.place(x = 5, y = 265) | |
result = tk.Entry(bone, width = 24) | |
result.place(x = 120, y = 265) | |
# Кнопки | |
ras = tk.Button(bone, text = 'Рассчитать', command = plus) | |
ras.place(x = 120, y = 290) | |
delras = tk.Button(bone, text = 'Очистить', command = delet) | |
delras.place(x = 225, y = 290) | |
bone.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment