473,394 Members | 1,843 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,394 software developers and data experts.

shelve file name extention

Hi All,
When I am using shelve on my local machine it generates the db file as
given filename. But in another machine it's generating <filename>.dat
and .dir.
can anyone tell me how can I force sheve module to write the db in
<filename>.dir and <filename>.dat, instead of <filename>? Do I have to
install a specific version of the python?

Thanks...
Monu
Sep 8 '08 #1
3 1174

MonuWhen I am using shelve on my local machine it generates the db
Monufile as given filename. But in another machine it's generating
Monu<filename>.dat and .dir. can anyone tell me how can I force sheve
Monumodule to write the db in <filename>.dir and <filename>.dat,
Monuinstead of <filename>? Do I have to install a specific version of
Monuthe python?

Shelve is just a thin layer on top of a concrete db file module. Sounds
like on your two machines there are different underlying db file modules
available. You're pretty much at the mercy of those modules as to file
naming. All you are giving it when opening a shelve file is the prefix.

Skip
Sep 8 '08 #2
On Sep 8, 1:47*pm, s...@pobox.com wrote:
* * MonuWhen I am using shelve on my local machine it generates thedb
* * Monufile as given filename. But in another machine it's generating
* * Monu<filename>.dat and .dir. *can anyone tell me how can I force sheve
* * Monumodule to write the db in <filename>.dir and <filename>.dat,
* * Monuinstead of <filename>? Do I have to install a specific version of
* * Monuthe python?

Shelve is just a thin layer on top of a concrete db file module. *Sounds
like on your two machines there are different underlying db file modules
available. *You're pretty much at the mercy of those modules as to file
naming. *All you are giving it when opening a shelve file is the prefix..

Skip
Thanks Skip.
So Can't I choose which module to use. Is there any preferance on
which shelve chooses these modules?
Sep 11 '08 #3
On Sep 8, 1:47*pm, s...@pobox.com wrote:
* * MonuWhen I am using shelve on my local machine it generates thedb
* * Monufile as given filename. But in another machine it's generating
* * Monu<filename>.dat and .dir. *can anyone tell me how can I force sheve
* * Monumodule to write the db in <filename>.dir and <filename>.dat,
* * Monuinstead of <filename>? Do I have to install a specific version of
* * Monuthe python?

Shelve is just a thin layer on top of a concrete db file module. *Sounds
like on your two machines there are different underlying db file modules
available. *You're pretty much at the mercy of those modules as to file
naming. *All you are giving it when opening a shelve file is the prefix..

Skip
Thanks Skip.
So Can't I choose which module to use. Is there any preferance on
which shelve chooses these modules?
Sep 11 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rami A. Kishek | last post by:
Hi - this mysterious behavior with shelve is just about to kill me. I hope someone here can shed some light. First of all, I have this piece of code which uses shelve to save instances of some...
0
by: seth | last post by:
Last week I encountered an AttributeError in my unit tests that I wasn'table to catch with an "except AttributeError" statement. The problem stemmed from a class that raised an error inside...
0
by: ex laguna | last post by:
Hi, I have ran into a problem with py2exe 0.5.0 and shelve in python 2.3.3. The script works fine standalone, but not with py2exe. Does anyone have a solution of workaround for this? Thanks...
0
by: Ray O | last post by:
I have read a number of threads relating to problems with shelve, but I couldn't find one directly related my experience, so I would appreciate some advice. The closest one ended with a...
3
by: Michele Petrazzo | last post by:
Hi, I'm trying a script on a debian 3.1 that has problems on shelve library. The same script work well on a fedora 2 and I don't know why it create this problem on debian: #extract from my code...
6
by: aomighty | last post by:
I wanted to write the following code: import shelve try: db = shelve.open(file, "r") except SomeError: print "Oh no, db not found" Only, I'm not sure what SomeError should be. I tried...
13
by: 7stud | last post by:
test1.py: -------------------- import shelve s = shelve.open("/Users/me/2testing/dir1/aaa.txt") s = "red" s.close() --------output:------ $ python test1.py
5
by: gluckj | last post by:
Hi, I'm not a Win ME fan myself (I'm a Mac user), but I'm here in Thailand developing software for special-needs kids, and the test PC in my home office is a Win ME machine (sigh). So when I...
2
by: hypermonkey2 | last post by:
Hi there! I am using the "shelve" module in a script to save information in between runtime sessions of the program. (its a sort of data collector, so its important to hold on to anything computed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...

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.