Help with ConfigParser

tony.ha at philips.com tony.ha at philips.com
Mon Oct 2 09:04:42 EDT 2006


Hello I use ConfigParser as show below to read a config.txt file;

from ConfigParser import ConfigParser

config = ConfigParser()
config.read('config.txt')
items = config.items('FV')
for item in items:
   module_name = item[0]
   print module_name


The config.txt file has the following

[FV]
# Set the module to "1" to enable the regression test run on it, otherwise 
set it to "0"

ip_dtlmmio0_1803: 0
ip_gpio0_4004: 0
ip_dmac0_1903: 0
ip_ptA_a_sdramc_2022: 1
ip_timer0_3012: 0



the output has been convert to lowercase, i.e ip_ptA_a_sdramc_2022  become 
ip_pta_a_sdramc_2022
(the captial letter 'A, become lower case 'a').

Question: How can I pervent ConfigParse to convert Upper case yo lower 
case??, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20061002/5845d4e8/attachment.html>


More information about the Python-list mailing list