473,608 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

gdbm troubles.

dictionary = gdbm.open('dict ionary','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 1223
On Thu, 11 Oct 2007 11:49:05 +0000, Shriphani wrote:
dictionary = gdbm.open('dict ionary','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('dict ionary','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
3338
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) anything about Fink. The default Python on Mac OS X is 2.3 but doesn't come with gdbm. Did anyone try to get the source of gdbm and build it, and somehow built the gdbm module for Python on Mac OS X? If so could you share a few hints? It'll...
1
4097
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__ == 'dumbdbm' or anydbm._defaultmod.__name__ == 'dbm'): First of, I'm doing this on a Sparc/Solaris 8 box. So, I'm trying to get gdbm to be the default mod. I've downloaded and
5
2835
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 kills python24\pythonw.exe in Pythonwin and SPE on import, though it's a VC++ Runtime Error, so it could be a different DLL problem somewhere...) It just seems a little odd that no one would have done this or that it's so tough to find. Of course, I...
1
1773
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 simple gdbm database causes the trouble. E.g. I create a one-entry db in python 1.5.2 Python 1.5.2 (#0, Apr 13 1999, 10:51:12) on win32 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import gdbm >>> db2 =...
0
873
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 = gdbm_obj.firstkey() if key is None: raise StopIteration yield key
0
1028
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 result is a 'gdbm fatal: read error.' Reversing directions results in the same problem. Below are two small programs that get at the heart of the problem: #test.py############## #!/usr/bin/env python
2
1982
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 (or at least, it has, but probably not linked properly to the more recent Sleepy Cat versions of the Berkeley DB - it fails to import _bsddb). Currently, I have to put python2.2 in my shebangs to get the cgi scripts to run at all. The question is...
4
1895
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 (which is returned by gdbm_open), but in the implementation of gdbm functions (e.g. gdbm_open in gdbmopen.c)work with a structure called gdbm_file_info. Now GDBM_FILE is defined like this in gdbm.h an exposed header :
0
723
by: Eric S. Johansson | last post by:
how thread safe is the gdbm module?
0
8470
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6815
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5475
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3960
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1328
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.