Skip to content

Instantly share code, notes, and snippets.

@xjxckk
Last active May 13, 2022 10:37
Show Gist options
  • Save xjxckk/a7e1935e07890666e13cba5268d25b59 to your computer and use it in GitHub Desktop.
Save xjxckk/a7e1935e07890666e13cba5268d25b59 to your computer and use it in GitHub Desktop.
Python config parser
'''
settings.ini:
[Settings]
username = my_username
password = my_password
'''
from configparser import ConfigParser
settings = ConfigParser()
settings.read('settings.ini')
username = settings['Settings']['username']
password = settings['Settings']['password']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment