Add a space between if and the opening bracket, between a closing round bracket and the following opening curly bracket, etc.
libledger will now be built as a shared library. You can 'import ledger' from python IFF you copy libledger.so to ledger.so or create a symlink.