Last active
May 13, 2022 10:37
-
-
Save xjxckk/a7e1935e07890666e13cba5268d25b59 to your computer and use it in GitHub Desktop.
Python config parser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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