How to modify the .ini file? My ini file looks like this. And i want the format section ini to be changed like this[Space to be replaced with a tab followed by $] Format="[%TimeStamp%] $(%ThreadID%) $<%Tag%> $%_%"
[Sink:2]Destination=TextFile
FileName=/usr/Desktop/A.log
RotationSize=5000000
MaxSize=50000000
MinFreeSpace=10000000
AutoFlush=true
Format="[%TimeStamp%] (%ThreadID%) <%Tag%> %_%"
Filter="%Severity% >= 0"
This is what i wrote
import ConfigParser
config = ConfigParser.RawConfigParser()
config.read('/usr/local/ZA/var/loggingSettings.ini')
format = config.get('Sink:2', 'Format')
tokens = "\t$".join(format.split())
print format
print tokens
config.set('Sink:2', 'Format', tokens)
newformat = config.get('Sink:2', 'Format')
print newformat
And the Output is the exact what i wanted.But when i open the .ini file, i see no changes here? Could be when i reading again the section , its loading from memory? How did i make the changes permanent