gdbm troubles.

S

Shriphani

dictionary = gdbm.open('dictionary','c')
dictionary['Ellipsize'] = 'Openbox'
dictionary.get('Ellipsize')

the last line generates an attribute error. Can someone tell me what I
am doing wrong?
Regards,
Shriphani Palakodety
 
M

Marc 'BlackJack' Rintsch

dictionary = gdbm.open('dictionary','c')
dictionary['Ellipsize'] = 'Openbox'
dictionary.get('Ellipsize')

the last line generates an attribute error. Can someone tell me what I
am doing wrong?

You are trying to use a method that does not exist. That `gdbm` object
doesn't have a `get()` method.

Ciao,
Marc 'BlackJack' Rintsch
 
L

Laszlo Nagy

Shriphani said:
dictionary = gdbm.open('dictionary','c')
dictionary['Ellipsize'] = 'Openbox'
dictionary.get('Ellipsize')
Try this:

print dictionary['Ellipsize']
del dictionary['Ellipsize']


gdbm objects are similar to builtin dictionaries. By the way, they are
not iterable, but they should be. I posted a proposal some days ago and
nobody was against this. How can I start a discussion about this? Can we
vote for this new feature here? Is this the right place?


Laszlo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top