The idea is to create rain. In the class "Drop" there are 2 methods: show (), which creates a line, and update (), which updates the coordinates, everything can be seen in the code:
def show(self): c.create_line(self.x, self.y, self.x, self.y+const, fill = "white") def update(self): self.y += self.yspeed drops = [Raindrop() for i in range(101)] def main(): for i in range(len(drops)): drops[i].show() drops[i].update() root.after(30,main) main() root.mainloop() A line will be drawn, then the coordinates will be updated and cyclically. It is logical that a new line will be drawn on the new coordinates, and the old line with the old coordinates will remain. This is actually the question: how to write the code to avoid it, i.e. When a new line is drawn on the new coordinates, the old one is erased?
