In order to use my example, your file "abc.txt" needs to look like:
[your-config]
path1 = "D:est1first"
path2 = "D:est2second"
path3 = "D:est2hird"
Then in your software you can use the config parser:
import ConfigParser
and then in your code:
configParser = ConfigParser.RawConfigParser()
configFilePath = r'c:abc.txt'
configParser.read(configFilePath)
Use case:
self.path = configParser.get('your-config', 'path1')
*Edit (@human.js)
In Python 3, ConfigParser is renamed to configparser (as described here)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…