Aug-01-2017, 02:36 AM
I am writing code in tkinter (on a mac, in Python 3.6)
Right now, I am writing some code that basically waits until a button is pressed, then opens a new window. I know a button can be hooked up to a function, but I don't want to write all the code for this new window inside of a new function. Is there any other way to do this?
More Info:
Right now, my code looks like this:
Right now, I am writing some code that basically waits until a button is pressed, then opens a new window. I know a button can be hooked up to a function, but I don't want to write all the code for this new window inside of a new function. Is there any other way to do this?
More Info:
Right now, my code looks like this:
select = Tk() var = IntVar() for index in range(0, len(worlds)): Radiobutton(select, text=worlds[index], variable=var, value=index, font=('Courier New', 20)).pack(anchor=W) def selWorld(num): select.quit() ## this will open a new tkinter window, but I don't want to write all my code for that window in this function. okButton = Button(select, text=' Begin Editing ', command=selWorld(var), font=("Courier New", 20)) okButton.pack(anchor=W) select.mainloop()Sorry if anything was unclear.