[Tutor] Problems with ConfigParser set method
dave selby
dave6502 at googlemail.com
Sat Mar 8 17:46:27 CET 2008
Hi All,
I am using the ConfigParser module, I can 'get' from a config file
fine, when I try to set it, it silently fails. the code.
parser = ConfigParser.SafeConfigParser()
parser.read('./daemon.rc')
print parser.get('feeds', 'number')
parser.set('feeds', 'number', '99')
print parser.get('feeds', 'number')
there is a section [feeds], and option number, it is set to 1. If I
execute the script I get ...
dave at dev-machine:/var/lib/kmotion/daemons$ ./daemon_start.py
1
99
dave at dev-machine:/var/lib/kmotion/daemons$ ./daemon_start.py
1
99
dave at dev-machine:/var/lib/kmotion/daemons$
The first call returns as expected, the second should return 99, 99
not 1, 99. On opening daemons.rc the 'number' option is not changed.
Any ideas ?
Cheers
Dave
--
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
More information about the Tutor
mailing list