'Why is my tkinter loop not modifying variable?
I am a beginner and experimented with tkinter (in Python) for a project. I am trying to let a loop pack numbers in a window but I yust cannot get it to work. It shuld count up from 0 but it packs only 0. Would be great if someone could help! Philipp
from tkinter import *
window = Tk()
window.title("window")
window.resizable(False, False)
window.geometry("500x500")
window.configure(background="white")
i = 0
while i < 100:
text = 0
label = Label(window, text=text)
label.pack()
print(text)
text += 1
i += 1
window.mainloop()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
