Created
February 22, 2018 07:25
-
-
Save martijnvandijk/56570e8d9280f76556ab13e731bf2594 to your computer and use it in GitHub Desktop.
Python ConfigParser demo
This file contains hidden or 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
[mongodb] | |
username = "Jantje" | |
password = "Hunter123" | |
host = "example.com" | |
port = "12345" |
This file contains hidden or 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
import configparser | |
config = configparser.RawConfigParser() | |
configFilePath = r'config.ini' | |
config.read(configFilePath) | |
print(config['mongodb']['password']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment