@buks_net
Школьник, изучаю программирование

Как запретить полям Entry копировать друг друга?

import tkinter as tk

def Voltage():
	voltage = resistance*amperage

def Resistance():
	resistance = voltage/amperage

def Amperage():
	amperage = voltage/resistance

def consistent_resistance():
	for i in resistance:
		sum += i

def parallel_resistance():
	for i in resistance:
		sum += i

resistance = int()
amperage = int()
voltage = int()

main_program = tk.Tk("White")
main_program.title("Расчитыватель Ома - 5000")
main_program.minsize(1100, 720)
main_program.maxsize(1100, 720)


amper_butt = tk.Button(main_program,
	width = 30,
	height = 3,
	text = 'Рассчитать\nСилу тока')

resist_butt = tk.Button(main_program,
	width = 30,
	height = 3,
	text = 'Рассчитать\nСопротивление')

volt_butt = tk.Button(main_program,
	width = 30,
	height = 3,
	text = 'Рассчитать\nНапряжение')

consist_resist_butt = tk.Button(main_program,
	width = 30,
	height = 3,
	text = 'Рассчитать\nПоследовательное сопротивление')

parallel_resist_butt = tk.Button(main_program,
	width = 30,
	height = 3,
	text = 'Рассчитать\nПоследовательное сопротивление')

resist_Entry = tk.Entry(main_program,
	width = 50,
	highlightthickness = 1,
	highlightcolor = 'black',
	highlightbackground = 'black',
	textvariable = resistance)

resist_Label = tk.Label(main_program,
	width = 30,
	height = 3,
	text = "R = ")

ampere_Entry = tk.Entry(main_program,
	width = 50,
	highlightthickness = 1,
	highlightcolor = 'black',
	highlightbackground = 'black',
	textvariable = amperage)

ampere_Label = tk.Label(main_program,
	width = 30,
	height = 3,
	text = "I = ")

volt_Entry = tk.Entry(main_program,
	width = 50,
	highlightthickness = 1,
	highlightcolor = 'black',
	highlightbackground = 'black',
	textvariable = voltage)

volt_Label = tk.Label(main_program,
	width = 30,
	height = 3,
	text = "V = ")

volt_butt.bind("<Button-1>", Voltage)
amper_butt.bind("<Button-1>", Amperage)
resist_butt.bind("<Button-1>", Resistance)
consist_resist_butt.bind("<Button-1>", consistent_resistance)
parallel_resist_butt.bind("<Button-1>", parallel_resistance)

volt_Label.pack(side = 'top')
volt_Entry.pack(side = 'top')
ampere_Label.pack(side = 'top')
ampere_Entry.pack(side = 'top')
resist_Label.pack(side = 'top')
resist_Entry.pack(side = 'top')
amper_butt.pack(side = 'right')
resist_butt.pack(side = 'right')
volt_butt.pack(side = 'left')
consist_resist_butt.pack(side = 'left')
parallel_resist_butt.pack(side = 'right')

input()

60b750055b746754354770.png
текст в полях для ввода копирует себя в остальные поля для ввода
  • Вопрос задан
  • 118 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы