def motion():
    c.move(vagon1, 1, 0)
    c.move(vagon2, 1, 0)
    c.move(line, 1, 0)
    if (c.coords(vagon1)[0] < 50):
        tab10.after(20, motion)
def motion():
    c.move(vagon1, 1, 0)
    c.move(vagon2, 1, 0)
    c.move(line, 1, 0)
    if (c.coords(vagon1)[0] < 50):
        tab10.after(20, motion)