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?

Advertisements

Guest

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

Advertisements

On Sep 8, 1:47 pm, wrote:
> Monu> When I am using shelve on my local machine it generates the db
> Monu> file as given filename. But in another machine it's generating
> Monu> <filename>.dat and .dir. can anyone tell me how can I force sheve
> Monu> module to write the db in <filename>.dir and <filename>.dat,
> Monu> instead of <filename>? Do I have to install a specific version of
> Monu> the 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?

On Sep 8, 1:47 pm, wrote:
> Monu> When I am using shelve on my local machine it generates the db
> Monu> file as given filename. But in another machine it's generating
> Monu> <filename>.dat and .dir. can anyone tell me how can I force sheve
> Monu> module to write the db in <filename>.dir and <filename>.dat,
> Monu> instead of <filename>? Do I have to install a specific version of
> Monu> the 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?

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!