title: Python set filemode in logging configuration file
body: <p>I am trying to config the loggers in a text configuration file using Python. Here is partial content:</p>
  
  <pre><code>[logger_root]
  handlers=result
  level=NOTSET
  
  [handler_result]
  class=handlers.TimedRotatingFileHandler
  interval=midnight
  backupCount=5
  formatter=simple
  level=DEBUG
  args=('result_log.txt')
  </code></pre>
  
  <p>I would like to rewrite the log file every time I run the system. But not know how to set it in the file. I try this but fails:</p>
  
  <pre><code>args=('result_log.txt',filemode='w')
  </code></pre>
  
  <p>A lot of articles talk about how to set it from the Python code. But I would like to set it in the file. How to do it? Thanks.</p>
  
  <p>=======================================</p>
  
  <p>Edit: I can write some info into the log file 'result_log.txt' by:</p>
  
  <pre><code>result_logger = logging.getLogger('result')
  result_logger.debug("info to write")
  </code></pre>
  
  <p>But I can only "append" to the file. I would like to rewrite the file every time i run.</p>