471,616 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

gdbm troubles.

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

Oct 11 '07 #1
2 1157
On Thu, 11 Oct 2007 11:49:05 +0000, Shriphani wrote:
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
Oct 11 '07 #2
Shriphani wrote:
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

Oct 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Fortepianissimo | last post: by
1 post views Thread by Ed | last post: by
reply views Thread by Laszlo Nagy | last post: by
reply views Thread by Douglas Applegate | last post: by
2 posts views Thread by RayOsborn | last post: by
4 posts views Thread by vshenoy | last post: by
reply views Thread by Eric S. Johansson | last post: by
1 post views Thread by XIAOLAOHU | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.