I'm using the ConfigParser to read the configuration information stored in a file. I'm able to read the content and use it across other modules in the project. I'm not sure if the configuration file is read every time I call config.get(parameters). How can I make sure that the configuration information is read only once and rest of the time its read from the cache.
+2
A:
I would try assigning the configuration to a variable.
configVariable = config.get(parameters)
Then you can pass the configuration variable to other modules as necessary.
opierce
2009-06-24 18:42:08
+1
A:
This isn't my answer, but user gimel came with this nifty solution: click
(You can check whole question pointed by this link, it is very similar to Yours.)
zeroDivisible
2009-06-24 18:44:38
+1
A:
The default implementation of the ConfigParser class reads its data only once.
tobidope
2009-06-24 18:51:41