Last active
January 16, 2016 21:27
-
-
Save paul-schwendenman/ff51e6b93788925c3bd6 to your computer and use it in GitHub Desktop.
Config parser example
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
[example] | |
username = this | |
password = that |
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
#!/usr/bin/env python3 | |
''' | |
configparser example | |
''' | |
import configparser | |
config.read('example.conf') | |
print('username:', config.get('example', 'username')) | |
print('password:', config.get('example', 'password')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment