Re: slicing a bsddb table, eg. for rec in bsddb["AArdvark":"zebra"]: print rec

2005-06-26 Thread Bengt Richter
On Sun, 12 Jun 2005 16:49:57 -0500, Skip Montanaro <[EMAIL PROTECTED]> wrote: > >Neville> # I was expecting a slice of an index file to yield a >Neville> # generator so not all the records need to be read from disk > >Slicing is a feature of sequence types, not mapping types. > >>>

Re: slicing a bsddb table, eg. for rec in bsddb["AArdvark":"zebra"]: print rec

2005-06-12 Thread Skip Montanaro
Neville> # I was expecting a slice of an index file to yield a Neville> # generator so not all the records need to be read from disk Slicing is a feature of sequence types, not mapping types. >>> import string >>> d = dict(zip(string.lowercase, string.uppercase)) >>> d

slicing a bsddb table, eg. for rec in bsddb["AArdvark":"zebra"]: print rec

2005-06-12 Thread Neville C. Dempsey
#!/bin/env python import bsddb test=bsddb.btopen("test.tbl") for m in "JFMATQPHSOND": test[m]="Profit for month "+m+" $1B" def subyear_report(record_selection): for data in record_selection.iteritems(): print data # I was expecting a slice of an index file to yield a # generator so not all