For use in scripts it might be helpful to get a flat list of accounts from a given gnucash file. Fortunately gnucash has an extensive python binding. See the script gnucash_accounts.py for an example on how to use it:
Continue reading “Get a list of gnucash accounts in python”Tag: python
pylint und Argumente von callback-Funktionen
Benutzt man eine Library, die Callback-Funktionen verlangt, hat man nicht unbedingt die Kontrolle über Anzahl und Verwendung der Argumente. Hier wird sich beispielsweise pylint beschweren mit “Unused argument ‘attrs’ (unused-argument)”:
def mycallback(arg1, arg2): pass
Glücklichweise gibt es eine Möglichkeit mit dem Präfix “cb_” pylint den Umstand mitzuteilen, daß es sich dabei um eine Callbackfunction handelt:
def cb_mycallback(arg1, arg2): pass
Damit mahnt pylint die Stelle nicht mehr an und akzeptiert, wenn man nicht an sämtlichen Informationen des Aufrufers interesiert ist.