dictionary to file

  • Thread starter =?Windows-1252?Q?Enrique_Palomo_Jim=E9nez?=
  • Start date
?

=?Windows-1252?Q?Enrique_Palomo_Jim=E9nez?=

Hi all,

I'm writing an application who needs to handle a lot of information of several files.
So, i think the better way is design a batch process to catch that information in a dictionary and write it in a file.
So, after that when a user wants to retrieve something, only with an execfile i'll have all the information avaiable.

Creating the file with pythonic syntax will be a hard job so,

is there some module to do that?
is there a better way?

The information will be used no more than 3-4 days a month and install databases is not allowed.

Thanks
 
M

Max M

Enrique said:
Hi all,

I'm writing an application who needs to handle a lot of information of several files.
So, i think the better way is design a batch process to catch that information in a dictionary and write it in a file.
So, after that when a user wants to retrieve something, only with an execfile i'll have all the information avaiable.

Creating the file with pythonic syntax will be a hard job so,

is there some module to do that?
is there a better way?


You can easily pickle a dictionary and save that to a file.

http://docs.python.org/lib/module-pickle.html

--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science
 
L

Larry Bates

You don't define what you mean by "a lot". Python can read
a tremendous amount of information from files in a very short
amount of time so I wouldn't try to prematurely optimize this.
Just read the information and see how long it takes. If it
is really a long time, then look for alternatives. It will
take some time to read the dictionary and to unpickle it.

-Larry
 
L

Larry Bates

You don't define what you mean by "a lot". Python can read
a tremendous amount of information from files in a very short
amount of time so I wouldn't try to prematurely optimize this.
Just read the information and see how long it takes. If it
is really a long time, then look for alternatives. It will
take some time to read the dictionary and to unpickle it.

-Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,321
Members
48,004
Latest member
KelseyFors

Latest Threads

Top