old_contents: import os
  import json
  
  default_conf = {
      'reddit': {
          'username': '',
          'password': '',
      },
      'twitter': {
          'consumer_key': '',
          'consumer_secret': '',
          'access_token': '',
          'access_secret': '',
      },
  }
  
  
  if __name__ == '__main__':
      if not os.path.isfile('config.json'):
          config = json.dumps(default_conf, indent=4, sort_keys=True)
          with open('config.json', 'w') as f:
              f.write(config)
  
          print 'Created default config in config.json, please edit'
  
new_contents: import os
  import json
  import sys
  
  default_conf = {
      'reddit': {
          'username': '',
          'password': '',
      },
      'twitter': {
          'consumer_key': '',
          'consumer_secret': '',
          'access_token': '',
          'access_secret': '',
      },
  }
  
  
  def write_conf(conf):
      config = json.dumps(conf, indent=4, sort_keys=True)
      with open('config.json', 'w') as f:
          f.write(config)
  
  
  if __name__ == '__main__':
      if not os.path.isfile('config.json'):
          write_conf(default_conf)
          print 'Created default config in config.json, please edit'
  
      elif 'updateconf' in sys.argv:
          with open('config.json', 'r') as f:
              config = json.loads(f.read())
  
          default_conf.update(config)
          write_conf(default_conf)
  
subject: Add twitter stuff to default config and allow easier merging of configs