Questions tagged [shelve]

Shelve can refer to either a Python object persistence or a pending change in a Visual Studio Workspace

A shelf in Python is a persistent, dictionary-like object. Documentation: shelve

Shelve can also refer to a pending change in the workspace within Visual Studio 2005

351 questions
3
votes
2 answers

python shelve ... bsddb deprecated ... how to get shelve to use another database?

I have an app developed in python 2.7.2 on OS X. I use the module shelve and seems to default to bsddb on the mac. The program won't run on a Windows 7 machine with ActiveState python 2.7 because the module bsddb is not present and is not in…
Tim Richardson
  • 6,608
  • 6
  • 44
  • 71
3
votes
1 answer

How do I checkout a perforce shelf at the changelist it was shelved at?

I have a perforce shelf that's CL 1000. It was shelved by someone else at some unknown CL X. I'm at CL 2000. I'd like to sync to whatever X is and unshelf 1000 so my code is exactly the same as when it was shelved. How do I do this?
idbrii
  • 10,975
  • 5
  • 66
  • 107
3
votes
2 answers

remotely start Python program in background

I need to use fabfile to remotely start some program in remote boxes from time to time, and get the results. Since the program takes a long while to finish, I wish to make it run in background and so I dont need to wait. So I tried os.fork() to make…
Sheng
  • 1,697
  • 4
  • 19
  • 33
3
votes
1 answer

Shelve - Can't delete entry

Hi this is my shelve entry structure { 'Birds' : { 'BlueOnes': ["detailsAboutBlueBird"], 'RedOnes' : ["detailsAboutRedBirds"] } } I'm trying to remove only BlueOnes Below is the code I'm using s =…
SunAwtCanvas
  • 1,261
  • 1
  • 13
  • 38
3
votes
3 answers

shelve module even not creating shelf

I am new to stackoverflow and experimenting with Python, currently just trying tutorial examples. Experienced a wonderful learning curve but got completely stuck with the following (working under windows 10): import shelve s =…
3
votes
1 answer

git shelving to remote repository

I would like to know if it's possible to use git with the following workflow: locally clone a remote repository make local changes commit them locally save them remotely so as not loose changes and in case I want to continue work on another…
opensas
  • 60,462
  • 79
  • 252
  • 386
3
votes
3 answers

Can't delete data from shelve (Automate the boring stuff book)

I am doing practice project from Chapter 8 of "Automate the boring stuff with Python". I need to write commands that will delete a keyword from shelf and delete the whole database of keywords. I don't know what to try more. None of my attempts to…
Carmin
  • 41
  • 3
3
votes
1 answer

Bad magic number in python shelve inside Docker

I have a python shelve file generated with python 3.4 and UTF-8 encoding. The file can be opened and accessed fine on the host. When I access the file inside a python:3.4 Docker container, I get >>> shelve.open('data/countries.shelf') Traceback…
Michael
  • 31
  • 1
3
votes
2 answers

Alternative to a very large dictionary (~40 million keys)

I have a rather large dictionary with about 40 million keys which I naively stored just by writing {key: value, key: value, ...} into a text file. I didn't consider the fact that I could never realistically access this data because python has an…
sToxic5
  • 73
  • 8
3
votes
2 answers

How can I open a python shelve file in a specific directory

I am working on Ch. 8 of "Automate the Boring Stuff With Python", trying to extend the Multiclipboard project. Here is my code: #! /usr/bin/env python3 # mcb.pyw saves and loads pieces of text to the clipboard # Usage: save - Saves…
D. Milotte
  • 33
  • 5
3
votes
1 answer

Can I update a p4 shelve that has been created by another user?

Is it possible to update a p4 shelve that has been created by another user? I know it is already difficult to update a shelve from another workspace, but still doable but i could not think of a way to update the shelve from another user. If anyone…
justrajdeep
  • 855
  • 3
  • 12
  • 29
3
votes
2 answers

Should we store session privileges in python shelve or as session variables?

Writing a web based flask api application with several modules. I would like to incorporate different permissions and privileges for different user logins for the different modules. Query is whether these privileges should be stored as session…
user956424
  • 1,611
  • 2
  • 37
  • 67
3
votes
2 answers

How can we modify data that is in a shelve?

I have opened a shelve using the following code: #!/usr/bin/python import shelve #Module:Shelve is imported to achieve persistence Accounts = 0 Victor = {'Name':'Victor…
Pavitar
  • 4,282
  • 10
  • 50
  • 82
3
votes
2 answers

How do I take integer keys in shelve?

I want to store an integer key in shelve. But when I try to store integer key in shelve it give me an error Traceback (most recent call last): File "./write.py", line 12, in data[id] = {"Id": id, "Name": name} File…
Searock
  • 6,278
  • 11
  • 62
  • 98
3
votes
0 answers

Shelve raises out of overflow pages

I have a lot of data that I read from a XML file, but only a part of it will be saved in the database later. The XML is structured like that: ...
prajmus
  • 3,171
  • 3
  • 31
  • 41