python-bindings: How to create a GncNumeric from a double

Ulrich Möhrke ulr_gnucash_user at moehrkevielfalt.de
Mon Dec 8 17:19:31 EST 2014


Hallo,

I want to write a python script, where a numeric value can be given as
command line argument. I want to use atof (locale.atof) to read the
string and than get a gnucash numeric value (GncNumeric) from the
result. 
At gnucash_core_c.py I found the function double_to_gnc_numeric but I
don't know, how to call this function within the python script. If I
want to include module gnucash_core_c directly I get the error:
File "....", line 3, in <module>
    import gnucash_core_c
ImportError: No module named gnucash_core_c

I'm at debian testing with python gnucash bindings
at /usr/lib/python2.7/dist-packages/gnucash/

Thanks for any help,
Ulrich




More information about the gnucash-user mailing list