Python port of ESOQ2.1

untested