So I am able to use a single variable ie. Voltage to print True
I am trying to use Voltage and Phase as arguments to print True but I am not having any luck
Here is my code so far:
from tkinter import *
def edit_or_retrieve():
Window = Tk()
Window.title("Main Menu")
Window.geometry("550x100")
Box = StringVar(Window)
Box.set("VOLTAGE")
Voltage = ["120", "208", "240", "277", "480"]
Dropdown = OptionMenu(Window, Box, *Voltage, command=lambda x: function(x, Window))
Dropdown.pack(side = "left")
Box = StringVar(Window)
Box.set("PHASE")
Phase = ["SINGLE PHASE", "THREE PHASE"]
Dropdown = OptionMenu(Window, Box, *Phase, command=lambda x: function(x, Window))
Dropdown.pack(side = "left")
Window.mainloop()
def function(value, Window):
if value == '120':
print(True)
edit_or_retrieve()
This will bring up a drop down box for Voltage and Phase, when I select Voltage I get True
Thanks for the help