{\rtf1\ansi\ansicpg1252\cocoartf1038
{\fonttbl\f0\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\sl264\slmult1\ql\qnatural\pardirnatural

\f0\fs28 \cf0 from ledger import *\
\
session.read_journal("doc/sample.dat")\
\
new_session = Session()\
\
set_session_context(new_session)\
session.read_journal("doc/sample.dat")\
set_session_content(session)     # restore the default session\
\
for txn in session.journal.transactions:\
    print txn.payee\
\
    for p in txn.postings:\
        print p.account, "->", p.amount}