Source

BrainMachine / Main.py

Full commit
#!/usr/bin/env python
import LangDef
import MainBrain

src = '''
class C():
    def __init__(self):
        self.a = 1
    def __getattr__(self, name):
        if name == 'b':
            return 2
        return 'unknown'

the = C()
print the.a - (5-2), the.b, the.c
'''

mb = MainBrain.MainBrain()
MainBrain.g_mb = mb
mb.DefineInLang(LangDef.python)
mb.ReadInBuf(src)
mb.DefineOutLang(LangDef.python_without_dyna)
for s in mb.Output():
    print s
mb.Run()