Python port of Flexwin