I do something similiar by just opening the config file for read and for .. readlines() through it until I find what I'm looking for.