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
13
votes
2 answers

error: db type is dbm.gnu, but the module is not available in windows

I installed python3.6 in windows machine. And get below error while open my.db file. my.db file created by my program in ubuntu16.04 in python3.6, using shelve module. In [1]: import shelve In [2]: db =…
13
votes
3 answers

shelve: db type could not be determined

I am using Pycharm. First of all whenever any module is imported in Pycharm. The complete import line fades out. But in case of import shelve doesn't fade out. Also when I run the file i get following errors: Traceback (most recent call last): …
abhimanyuaryan
  • 3,882
  • 5
  • 41
  • 83
12
votes
3 answers

Mercurial - Working with Queues similar to Shelves?

I've recently started working with MQ as I like the idea of working on isolated patches and committing without affecting the repo until the changeset is refined enough. Before that, I used to work with Mercurial's shelves extension, but found it a…
sa125
  • 28,121
  • 38
  • 111
  • 153
12
votes
3 answers

Is shelve in Python thread safe?

Is shelve in Python used for data persistence thread safe? If not, what's a good alternative?
Tianyang Li
  • 1,755
  • 5
  • 26
  • 42
12
votes
3 answers

Perforce equivalent of git local commit

I just started using Perforce after using Git for a year. Is there any equivalent of a git local commit to my branch in perforce. Essentially, if I want to work on a complex task which might need undoing and redoing of my specific changes, is there…
user2829702
  • 133
  • 1
  • 6
11
votes
4 answers

Using python shelve cross-platform

I am hoping for a little advice on shelves/databases in Python. Problem: I have a database created on the mac, that I want to use on windows 7. I use Python 3.2, MacOS 10.7, and win 7. When I open and save my shelve on the mac all is good and well.…
Esben
  • 227
  • 2
  • 7
11
votes
6 answers

How do I make shelve file empty in python?

I have created a shelve file and inserted a dictionary data. Now I want to cleanup that shelve file to reuse as a clean file. import shelve dict = shelve.open("Sample.db") # insert some data into sample.db dict = { "foo" : "bar"} #Now I want to…
Abhishek Kulkarni
  • 3,693
  • 8
  • 35
  • 42
10
votes
3 answers

Ways to store and access large (~10 GB) lists in Python?

I have a large set of strings that I'm using for natural language processing research, and I'd like a nice way to store it in Python. I could use pickle, but loading the entire list into memory would then be an impossibility (I believe), as it's…
Wesley May
  • 313
  • 2
  • 13
9
votes
2 answers

In svn, can I revert a change and shelve it for later?

I have some changes commited a few commits back in my svn repository. Let's say HEAD is at r750 and I want to revert r745 without losing r746-r750. Is this possible? And, can I somehow save r745 and reapply it later (as a new revision)?
Grant
  • 2,838
  • 1
  • 19
  • 17
9
votes
1 answer

Python Shelve Module Memory Consumption

I have been assigned the task of reading a .txt file which is a log of various events and writing some of those events into a dictionary. The problem is that the file can sometimes get bigger than 3GB in size. This means that the dictionary gets too…
inspectorG4dget
  • 110,290
  • 27
  • 149
  • 241
8
votes
2 answers

How can I use Perforce Shelving to have one person create a change and another person submit it?

I want UserA to be able to create a changelist in Perforce and then Shelve it. I would then like UserB to be able to unshelve that changelist and submit it. This sounds simple, but Perforce unshelving doesn't seem to work the way I would expect.…
Jay Spang
  • 2,013
  • 7
  • 27
  • 32
8
votes
5 answers

Hg (Mercurial): any way to "set aside" the working copy for later?

Scenario: After your last commit, you decided to do some extensive refactoring of the codebase. After a time, you realize it is taking longer than expected, and you'd really rather put off the refactoring for another time, and work on more pressing…
Nairou
  • 3,585
  • 5
  • 29
  • 47
8
votes
0 answers

TFS - Is it possible to link a shelve to a work item? Automatically? (And more)

Hmm I think the question itself is pretty straight-forward... In Team Foundation 2010, is it possible to link a shelveset to a work item in some way ? If so, is it possible to automatically create this link when the developer shelves and associates…
Conrad Clark
  • 4,533
  • 5
  • 45
  • 70
8
votes
4 answers

Python shelve module question

Does the Python shelve module have any protection built in to make sure two processes aren't writing to a file at the same time?
Evan Fosmark
  • 98,895
  • 36
  • 105
  • 117
8
votes
2 answers

Python: What to worry about when mutliple processes are concurrently writing to "shelve"?

For my python application I am thinking of using shelve, part of the standard library. There will be hundreds of processes, each writing something to the same shelve object. The writing will always be to add a new key,value pair to the shelve. The…
Anas Elghafari
  • 1,062
  • 1
  • 10
  • 20
1
2
3
23 24