Painting application in Python