May-29-2018, 10:47 PM
Im a bit stuck!
Im new to python coding, this is my second project and Ive hit a wall.
Im trying to make a drinks dispenser for a big party
basically Ive made a GUI with 12 radio buttons in 3 sets, (3,3,6) plus an "execute" button.
what i want is to be able to select 3 options from the GUI and when i hit the "execute" button for it to run the appropriate .py file
i have got it working to return a value from the 3 variables like so:
all possible returned values have a corresponding .py file saved with its own script.
where im getting stuck is using the returned value from sel to run the right file when i hit the "execute" button.
thanks for any help
Im new to python coding, this is my second project and Ive hit a wall.
Im trying to make a drinks dispenser for a big party
basically Ive made a GUI with 12 radio buttons in 3 sets, (3,3,6) plus an "execute" button.
what i want is to be able to select 3 options from the GUI and when i hit the "execute" button for it to run the appropriate .py file
i have got it working to return a value from the 3 variables like so:
dr1 = StringVar() dr2 = StringVar() dr3 = StringVar() def sel(): X = dr1.get() Y = dr2.get() Z = dr3.get() return X+Y+ZThe radio buttons can return 54 possible combinations and I have 54 separate scripts written for each one and saved with the same names as the possible returned value. For example- 111,112,113,121,122,123 and so on. (Values and files are words not numbers so I can identify then easily but they’re long so I’m not writing them here).
all possible returned values have a corresponding .py file saved with its own script.
where im getting stuck is using the returned value from sel to run the right file when i hit the "execute" button.
def drink(): #im stuck here! b1 = Button(root, text="Make", bd=1, bg="white", relief="solid", font="Times 32", width=14, command = drink)When I hit the button b1 I need the main script to run the file generated by "sel"
thanks for any help