Partial support for Python code generator - not yet fully tested