Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 165 results for
shelve
- Page 1
seeming limit on number of shelve records?
Programming
Software Development
16 Years Ago
by tomoconnell
…name name = getattr(testrecord, 'name') import
shelve
db =
shelve
.open('eride') db[name] = testrecord db.close…cnt +1 def listtest(self): import
shelve
db =
shelve
.open(testfile) test = raw_input("test…
Re: seeming limit on number of shelve records?
Programming
Software Development
16 Years Ago
by tomoconnell
…name name = getattr(testrecord, 'name') import
shelve
db =
shelve
.open(testfile) db[name] = testrecord def …close() def listtest(self): import
shelve
db =
shelve
.open(testfile) cnt = 1 while…
Re: seeming limit on number of shelve records?
Programming
Software Development
16 Years Ago
by tomoconnell
…, thanks to the kickbutt moderator. I tried to break his
shelve
code the same way mine broke, but could not. Went… the two, and my error was that I open the
shelve
in a routine to look at the key, to know… record, in in this save routine I RE-open the
shelve
.. THIS is what messes stuff up. When i move the…
Re: I am trying to get values from a shelve db but it keeps failing
Programming
Software Development
12 Years Ago
by SamarthWiz
…quot;, filetypes = ["*.dat"] ) try: db =
shelve
.open(file, writeback=True) Items = db.values() self.components…;, filetypes = ["*.dat"] ) try: db =
shelve
.open(file, writeback=True) Items = db.values() self.components…
Re: Persistent to file dictionary using Python module shelve
Programming
Software Development
10 Years Ago
by Gribouillis
….python.org/pypi/ZODB) instead of [
shelve
](http://docs.python.org/3/library/
shelve
.html#module-
shelve
). ''' zodb_test.py Use third party module…
I am trying to get values from a shelve db but it keeps failing
Programming
Software Development
12 Years Ago
by SamarthWiz
Hi I am trying open a record from a
shelve
db I Know that it stops working at `copy = db[…
Re: I am trying to get values from a shelve db but it keeps failing
Programming
Software Development
12 Years Ago
by Gribouillis
If it stops working, there must be a traceback or something. Can you post the traceback ? Also your code doesn't show what is db nor its content, perhaps you could attach the
shelve
file in a zipped form. The 'global db' statements are suspicious. At best, they serve no purpose.
Persistent to file dictionary using Python module shelve
Programming
Software Development
10 Years Ago
by vegaseat
The code shows you how to create a persistent to file dictionary of data using the python module
shelve
.
Re: Newbie- Need Assistance
Programming
Software Development
16 Years Ago
by olufunkky
…'): self.dbname = dbname; self.
shelve
=
shelve
.open(self.dbname); def __del__(self): self.
shelve
.close() self.
shelve
= None def add(self, name…self, string): list = [] for key in self.
shelve
.keys(): e = self.
shelve
[key] if cmp(e, string) == 0: …
Newbie- Need Assistance
Programming
Software Development
16 Years Ago
by olufunkky
…'): self.dbname = dbname; self.
shelve
=
shelve
.open(self.dbname); def __del__(self): self.
shelve
.close() self.
shelve
= None def add(self, name…self, string): list = [] for key in self.
shelve
.keys(): e = self.
shelve
[key] if cmp(e, string) == 0: …
Need help enhancing a program
Programming
Software Development
17 Years Ago
by biganimal
….dbname = dbname; self.
shelve
=
shelve
.open(self.dbname); def __del__(self): self.
shelve
.close() self.
shelve
= None def add(self…type = HOME): e = phoneentry(name, number, type) self.
shelve
[str(e)] = e def lookup(self, string): list =… [] for key in self.
shelve
.keys(): e = self.
shelve
[key] if cmp(e, string) == …
Re: Need help enhancing a program
Programming
Software Development
17 Years Ago
by bumsfeld
… self.dbname = dbname; self.
shelve
=
shelve
.open(self.dbname); def __del__(self): self.
shelve
.close() self.
shelve
= None def add(self, …self, string): list = [] for key in self.
shelve
.keys(): e = self.
shelve
[key] if cmp(e, string) == 0: …
Re: Newbie- Need Assistance
Programming
Software Development
16 Years Ago
by olufunkky
…'): self.dbname = dbname; self.
shelve
=
shelve
.open(self.dbname); def __del__(self): self.
shelve
.close() self.
shelve
= None def add(self, name…self, string): list = [] for key in self.
shelve
.keys(): e = self.
shelve
[key] if cmp(e, string) == 0: …
Help with delete contact in a db
Programming
Software Development
11 Years Ago
by jeremywduncan
… = dbname; self.
shelve
=
shelve
.open(self.dbname); def __del__(self): self.
shelve
.close() self.
shelve
= None def add…list = [] for key in self.
shelve
.keys(): e = self.
shelve
[key] if cmp(e, string) …
Please help me to make a phonebook with Python
Programming
Software Development
13 Years Ago
by darma001
…). Add persistence to the phonebook program by using module
shelve
. “Persistence” means that data is retained also when …the program stops executing. Objects created by opening a “
shelve
” behave largely like dictionaries. So we may replace the… dictionary by a “
shelve
”, and the functions that alter the phonebook should still…
Re: Help with delete contact in a db
Programming
Software Development
11 Years Ago
by woooee
… an error on the first test lookup at e = self.
shelve
[key] because the keys are not correct. If it works… to how he adds data to a
shelve
object. Deleting is just del self.
shelve
[key], but you also have to set…
Re: Help with delete contact in a db
Programming
Software Development
11 Years Ago
by woooee
You have to set writeback=True for changes to be made to the db. Doug Hellmann has a nice write up [Click Here](http://doughellmann.com/2007/08/pymotw-
shelve
.html)
Re: Please help me to make a phonebook with Python
Programming
Software Development
13 Years Ago
by griswolf
… the default? [/LIST] edit: I see there is something called '
shelve
' that will handle my last two points. OK. If you…
how do you iterate though a file on a shelf?
Programming
Software Development
16 Years Ago
by tomoconnell
… very strange results from the following: def list(self) import
shelve
db =
shelve
.open(testfile) list = [] cnt = 0 for id in db… walk through a variable length list, that you stored via
shelve
?
Re: how do you iterate though a file on a shelf?
Programming
Software Development
16 Years Ago
by vegaseat
I am not sure if you are working correctly with the module
shelve
. For an example see Starting Python post: [url]http://www.daniweb.com/forums/post490861-110.html[/url] Remember
shelve
behaves like a 'persistent to file' dictionary.
Python Help..... Please?
Programming
Software Development
13 Years Ago
by Fearx351
…are below. [code] def high_Priority(): ## print'' import
shelve
high_space = 3000 file_sizeh = file_size * week_selec h_back = high_space - …file_sizeh db =
shelve
.open("netback.dat") db['hremspace'] = h_back db…
Re: Python Help..... Please?
Programming
Software Development
13 Years Ago
by Beat_Slayer
… the context but... [CODE]def high_Priority(): ## print'' import
shelve
file_sizeh = file_size * week_selec db =
shelve
.open("netback.dat") db['hremspace'] = h_back…
Re: keys problem
Programming
Software Development
15 Years Ago
by jrcagle
…;Python"] >>> import
shelve
## set up an example >>> f=
shelve
.open("mydatabase") >>…
Re: Python Help..... Please?
Programming
Software Development
13 Years Ago
by Fearx351
… to work. [code] file_sizeh = file_size * week_selec h_back = high_space - file_sizeh db =
shelve
.open('netback.dat') db['hremspace'] = h_back db['netback'] = back_name db…
need help with pickling please
Programming
Software Development
17 Years Ago
by whoru
…'s the code I have so far: [code] import cPickle,
shelve
player_score=[name, score] high_scores=open("high_scores.dat", "…
Re: need help with pickling please
Programming
Software Development
17 Years Ago
by vegaseat
Looks to me like you have to append more names and scores to your player_score list before you use cPickle. The module cPickle just dumps and loads complete objects, it does not append the present object file. There is no need to import
shelve
, since you are not using it.
Re: need help with pickling please
Programming
Software Development
17 Years Ago
by whoru
… the present object file. There is no need to import
shelve
, since you are not using it.[/quote] I was able…
Mailing List Scripts
Programming
Web Development
17 Years Ago
by zippee
Hi there, I am trying to integrate a simple mailing list/newsletter script (in php) to my site, which will be share by my clients (to their customers). Is there any off the
shelve
and free one available? I knw I may find it from hotscripts.com, but would appreciate any good recommendations.
keys problem
Programming
Software Development
15 Years Ago
by eibwen
… point me in the right direction please? I have a
shelve
object- book. If I do book.keys(), naturally I get…
MySQLdb interface problem
Programming
Databases
14 Years Ago
by bhanu1225
…_sqlite3 grp sgmllib DocXMLRPCServer _sre gzip sha EasyDialogs _ssl hashlib
shelve
Explorer _strptime heapq shlex FileDialog _struct hmac shutil Finder _symtable…
1
2
3
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC