473,408 Members | 2,888 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,408 software developers and data experts.

dictionary to file

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
Sep 16 '05 #1
3 1647
Enrique Palomo Jiménez wrote:
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
Sep 16 '05 #2
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

Enrique Palomo Jiménez wrote:
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

Sep 16 '05 #3
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

Enrique Palomo Jiménez wrote:
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


Sep 16 '05 #4

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

Similar topics

7
by: Thomas Philips | last post by:
I want to print "1 spam 4 you" using a formatted string that gets its inputs from the dictionary d={'n1':1, 's1':'spam', 'n2':4}. To do so, I write >>> x="%('n1')d %('s1')s %('n2')d you" >>> x...
12
by: Antoon Pardon | last post by:
Well at least I find them missing. For the moment I frequently come across the following cases. 1) Two files, each with key-value pairs for the same dictionary. However it is an error if the...
7
by: rickle | last post by:
I'm trying to compare sun patch levels on a server to those of what sun is recommending. For those that aren't familiar with sun patch numbering here is a quick run down. A patch number shows...
4
by: Noah | last post by:
I have a dictionary that I would like to expand to satisfy a function's agument list. I can used the ** syntax to pass a dictionary, but this only works if each key in the dictionary matches an...
9
by: oz | last post by:
Hi All, I want to make a dictionary with windows application. My data is html format. therefore, i use webBrowser control on my windows form. If the user click any word in webBrowser control,...
5
by: rohit | last post by:
i want to implement a dictionary in python the query is : without explicitly doing the following steps 1. reading from file to list 2. processing list to dictionary is there a module or a built...
0
GTXY20
by: GTXY20 | last post by:
Hi all, I currently have a CSV file like so 1,a 1,b 1,c 2,a 2,b 2,b
2
by: =?Utf-8?B?U2hhd24=?= | last post by:
Hi; I would like to be able to use the XMLSerializer to serialize and deserialize a dictionary. is that possible? i know that you can serialize an object that implements the ICollection interface....
2
by: Nagu | last post by:
I am trying to save a dictionary of size 65000X50 to a local file and I get the memory error problem. How do I go about resolving this? Is there way to partition the pickle object and combine...
20
by: Simon Strobl | last post by:
Hello, I tried to load a 6.8G large dictionary on a server that has 128G of memory. I got a memory error. I used Python 2.5.2. How can I load my data? SImon
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.