I've been creating a game using Python, and in one of my functions,
def Enemy_Party(enemies, party):
def Sub_Fight(member, enemy, enemies, Prep):
Prep.destroy()
Fight(member, enemy, enemies)
for x in enemies:
Prep = Tk()
for y in party:
button = Button(Prep, text=y.name, command=Sub_Fight(y, x, enemies, Prep)).pack()
Prep.mainloop()
a single window is created, but with nothing in it. There is no error message, the blank window just sits there.
Yes, I have a function Fight, and it does take four arguments. Both 'enemies' and 'party' are defined as lists, and both have values within them (I've checked).
On that note, I have two questions: "Why does the program halt after creating one blank window?" and "Can you define windows in a 'For Loop'?
Let me know if you need any more code, and thanks ahead of time.
button = Button(Prep, text=y.name, command=Sub_Fight(y, x, enemies, Prep)).pack()will result in button being null. The reason is that pack returns null. Maybe this is part of the issue you are having?