473,372 Members | 940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 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 1215
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fortepianissimo | last post by:
First off I know I can install the latest python from Fink quite easily and it'll give me everything needed. But I'm trying to distribute my python app to end users who don't really care (or know)...
1
by: Ed | last post by:
I am trying to use a Perl script which requires a Database module other than "dbm" to be the default Mod. So, what the script is checking is import anydbm if (anydbm._defaultmod.__name__ ==...
5
by: brokow | last post by:
I was lucky to find Milton L. Hankins' Python 1.5 port of gdbm.pyd on the web a while ago, but I was wondering if there is one that works with a more recent version of Python? (For me, that one...
1
by: brokow | last post by:
I have been trying to get the gdbm module in python 2.4 to read a gdbm file from python 1.5.2 and having no luck. I get a file error when I try to open the 1.5.2-created gdbm file. Even a very...
0
by: Laszlo Nagy | last post by:
Hi All, gdbm objects have a "firstkey" and a "nextkey" method. So if I want iterate through the keys (which I often do) then I have to do this: def itergdbmkeys(gdbm_obj): key =...
0
by: Douglas Applegate | last post by:
Hi- I am having a problem with shelve. The problem I think is really with gdbm. I'll write out a file using shelve/gdbm on an amd64 machine and then I'll try to read it in on a i386 machine. The...
2
by: RayOsborn | last post by:
I have some old "shelve" databases created in Python 2.2 that use the old bsddb format, whereas the version of Python 2.4 installed by my web hosting service doesn't have bsddb available at all...
4
by: vshenoy | last post by:
Hi Guys, I was going through gdbm-1.8.3 source (http://ftp.gnu.org/gnu/gdbm/ gdbm-1.8.3.tar.gz) and found this strange thing : all the exposed functions of gdbm work with GDBM_FILE pointer...
0
by: Eric S. Johansson | last post by:
how thread safe is the gdbm module?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.