On 28/01/2011 00:58, mpnordland wrote:
thanks for explaining what I was doing wrong and how reading the file works. What would you suggest I do to remedy the situation?
Write the new config out to a new file and then replace the old file with the new file. I'd use shutil.move(...) to do the replacement. This means that the existing config file will remain unchanged until you've successfully created the new config file (it's somewhat annoying if you're modifying a file and there's an exception part way through due to a bug, leaving 'invalid' contents!) -- http://mail.python.org/mailman/listinfo/python-list