import sys import frams framspath = sys.argv[1] # set to the directory where Framsticks binaries and libraries exist frams.init(framspath, "-Ddata") # "-D"+os.path.join(framspath,"data")) # not possible (maybe python windows issue) because of the need for os.chdir(). So we assume "data" is where the dll/so is 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))