import sys import frams frams.init(*(sys.argv[1:])) # pass whatever args we have, init() is the right place to deal with different scenarios: # frams.init() - should try to figure out everything (and might fail) # frams.init('path/to/lib') - load the library from the specified directory and configure Framsticks path as "data" inside this directory # frams.init('path/to/lib','-d/tmp/workdir/data') - as above, but set the working (writable) directory somewhere else (see also -D) # frams.init('path/to/lib','-Lframs-objects-alt.dll') - use specified library location and non-default file name 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))