Last active
November 3, 2020 18:25
-
-
Save bockor/549983def0acdc5eb8fded38702992c3 to your computer and use it in GitHub Desktop.
python configparser
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
[DEFAULT] | |
DEBUG = True | |
domaindb_file = ./dummy_data/dummy_domaindb.json | |
servers_file = ./dummy_data/dummy_servers.json | |
#WSGI Server | |
host = 101.135.27.63 | |
port = 8080 | |
debug = True | |
reloader = True | |
from configparser import ConfigParser | |
parser = ConfigParser() | |
parser.read('config.ini') | |
my_port = parser.get('DEFAULT','port') | |
my_host = parser.get('DEFAULT','host') | |
debug = parser.getboolean('DEFAULT','DEBUG') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment