Skip to content

Instantly share code, notes, and snippets.

@rusnino
Created February 12, 2019 21:00
Show Gist options
  • Save rusnino/7586aee50ee05e6529e8cf87be90e676 to your computer and use it in GitHub Desktop.
Save rusnino/7586aee50ee05e6529e8cf87be90e676 to your computer and use it in GitHub Desktop.
def generate_config_dict(filename):
'''
'''
config_dict = {}
with open(filename, 'r') as f:
for line in f:
if not line.startswith('!') and not ignore_command(line, ignore) and not line.startswith(' '):
keyword = line.rstrip()
elif not line.startswith('!') and not ignore_command(line, ignore):
config_dict[keyword].append(line.rstrip())
return(config_dict)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment