import sys import frams frams.init(*(sys.argv[1:])) #pass whatever args we have, init() is the right place to deal with different scenrios: # frams.init() - should try to figure out everything (and might fail) # frams.init('path/to/frams') - load the library from the specified dir and configure framsticks path as "data" inside the dir # frams.init('path/to/frams','-d/tmp/workdir/data') - as above, but set the working (writable) directory somewhere else print('Available objects:', dir(frams)) print() def extValueDetails(v): return '"' + str(v) + '" frams type=' + str(v._type()) + ' frams class=' + str(v._class()) + ' python type=' + str(type(v._value())) v = frams.String.deserialize('[100,2.2,"abc",[null,[]],XYZ[9,8,7]]') print(extValueDetails(v)) for e in v: print(extValueDetails(e)) g = frams.GenePools[0].add('X') g.name = "py!" g.data['custom'] = 123.456 g.data['a'] = 'b' for more in range(5): frams.GenePools[0].add(frams.GenMan.mutate(g.geno)) for g in frams.GenePools[0]: print(str(g.index) + '. "' + str(g.name) + '" ' + str(g.genotype) + ' data=' + str(g.data))