[Python] Tkinter can't delete something from a canvas on ubuntu

Discussão em 'Python' iniciado por Stack, Abril 22, 2025.

  1. Stack

    Stack Membro Participativo

    I created a programm on python to read serial data from an arduino and show it on a tkinter window. I made a Thread to read the from the arduino and the tkinter programm. My Programm runs perfectly on windows but the problem is that i want to use it on my ubuntu laptop and there it doesn't work. It works ok but there are some problems. I have some sensor values that update if some new information comes from the arduino, but the values are not shown. Also and most importend no buttons work and I can't close the window. I narrowt down the problem to this function:

    def delete_Text(self):
    if self.anzahl == 1:
    self.canvas.delete(self.tag)
    else:
    for i in range(0, self.anzahl):
    self.canvas.delete(self.tag + str(i))


    I don't understand what is wrong with this function. I mean it worked and it doesn't show any error idk, but it's logic that the text is not updating, because I update the text with deleting and creating a new text. Hopfully somebody can help me

    Continue reading...

Compartilhe esta Página