Preliminary code generator in Python