Esempio n. 1
0
 def test01(self):
     a = pmt_swig.pmt_intern("a")
     b = pmt_swig.pmt_from_double(123765)
     d1 = pmt_swig.pmt_make_dict()
     d2 = pmt_swig.pmt_dict_add(d1, a, b)
     pmt_swig.pmt_print(d2)
Esempio n. 2
0
def pmt_from_dict(p):
    d = pmt.pmt_make_dict()
    for k, v in p.iteritems():
        #dict is immutable -> therefore pmt_dict_add returns the new dict
        d = pmt.pmt_dict_add(d, python_to_pmt(k), python_to_pmt(v))
    return d
Esempio n. 3
0
 def test01 (self):
     a = pmt_swig.pmt_intern("a")
     b = pmt_swig.pmt_from_double(123765)
     d1 = pmt_swig.pmt_make_dict()
     d2 = pmt_swig.pmt_dict_add(d1, a, b)
     pmt_swig.pmt_print(d2)
Esempio n. 4
0
def pmt_from_dict(p):
    d = pmt.pmt_make_dict()
    for k, v in p.iteritems():
        # dict is immutable -> therefore pmt_dict_add returns the new dict
        d = pmt.pmt_dict_add(d, python_to_pmt(k), python_to_pmt(v))
    return d