Re: bsddb for k, v in db.items(): do order the numbers ?

2005-03-07 Thread martijn
uhm i'm trying to make a very simple but large database: Let's say I want these fields : |name|age|country| Then I can't do this because I use the same key db[name] = 'piet' db[age] = '20' db[country] = 'nl' #same keys so it wil overwrite db[name] = 'jan' db[age] = '40' db[country] = 'eng'

Re: bsddb for k, v in db.items(): do order the numbers ?

2005-03-07 Thread Ulf Göransson
[EMAIL PROTECTED] wrote: uhm i'm trying to make a very simple but large database: Let's say I want these fields : |name|age|country| Then I can't do this because I use the same key db[name] = 'piet' db[age] = '20' db[country] = 'nl' #same keys so it wil overwrite db[name] = 'jan' db[age] =

Re: bsddb for k, v in db.items(): do order the numbers ?

2005-03-02 Thread Denis S. Otkidach
On Mon, 28 Feb 2005 11:48:44 -0500 Christopher De Vries [EMAIL PROTECTED] wrote: If you want your key, value pairs in a certain order you have to sort them yourself. Dictionaries and bsddb keys are unsorted. You are not right, records in BTree (btopen) are certainly sorted. For positive

Re: bsddb for k, v in db.items(): do order the numbers ?

2005-03-02 Thread Christopher De Vries
On Wed, Mar 02, 2005 at 01:31:04PM +0300, Denis S. Otkidach wrote: You are not right, records in BTree (btopen) are certainly sorted. For positive integers you can pack keys with struct.pack('I', value). You're right... I missed the btopen (rather a key thing to miss I know, but when you have

Re: bsddb for k, v in db.items(): do order the numbers ?

2005-03-01 Thread martijn
oyea, I must convert it to numbers ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: bsddb for k, v in db.items(): do order the numbers ?

2005-02-28 Thread Christopher De Vries
On Mon, Feb 28, 2005 at 08:30:59AM -0800, [EMAIL PROTECTED] wrote: WHen I use the code below and printing all the results i get this: -- 0 1 10 11 2 3 4 5 6 7 8 9 -- But I want -- 0 1 2 3 4 5 6 7 8 9 10 11 -- If you want your key, value pairs in a certain order you

Re: bsddb for k, v in db.items(): do order the numbers ?

2005-02-28 Thread Steve Holden
Christopher De Vries wrote: On Mon, Feb 28, 2005 at 08:30:59AM -0800, [EMAIL PROTECTED] wrote: WHen I use the code below and printing all the results i get this: -- 0 1 10 11 2 3 4 5 6 7 8 9 -- But I want -- 0 1 2 3 4 5 6 7 8 9 10 11 -- If you want your key, value pairs in a