Yes, this is exactly what I do.
On May 12, 12:17 am, John Wiegley <[email protected]> wrote: > >>>>> henry atting <[email protected]> > >>>>> writes: > > Just out of curiousity... I never managed to get any small python script > > running, ledger built with/or without python or whatsoever. My current > > version is a build from today: Ledger 3.0.0-20110325; with --python > > dir(ledger) displays what it should. No script provided in this thread does > > work though. E.g. this one: > > import ledger > > for xact in ledger.read_journal("sample.dat").xacts: > > for post in xact.posts: > > print "Transferring %s to/from %s" % (post.amount, > > post.account) > > Leads to this error message: > > Traceback (most recent call last): > > File "/home/me/script.py", line 3, in <module> > > for xact in ledger.read_journal("sample.dat").xacts: > > AttributeError: 'module' object has no attribute 'read_journal' > > How are you invoking the script? Please try "ledger python foo.py". > > John
