Python Forum
Homework/tkinter/python - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Homework/tkinter/python (/thread-6942.html)



Homework/tkinter/python - flaiwaier - Dec-14-2017

So,
I'm making a game, where mathematical operation displays on screen (+-/*) and you have to answer to this.
Now I have a problem.
[Image: 25323880_1737092623009353_643139051_n.png]
The old number remains there, my friend told me to change label but I don't know where... I have some other problems aswell, so I think it would be easier to talk somewhere else (facebook, skype etc).

https://gist.github.com/anonymous/3d7fe1ba5668804b610f0a3ccc0620b3
The problem starts from line 1001 (def update():)


RE: Homework/tkinter/python - nilamo - Dec-14-2017

Ok, so what you do currently, is you create a new label each time you run update().  So if the old label is wider than the new one, you can still see it.

Quote:
    tehe= ttk.Label(raam, text=str(tehe), foreground = 'black', background='white', font='none 60 bold')
    tehe.place(x=20, y=100)

It sounds like what your friend is suggesting (and what I also am suggesting), is that you stop creating new labels, and instead only have one, which you change the text to.


RE: Homework/tkinter/python - flaiwaier - Dec-15-2017

Where do I put this codeline and what I have to change? Sorry not so good in python yet :D