bla=value1 mumble=value2=3
This function handles also the case where a value contains a = sign
def getProperties(thepropertyfile): properties = dict() for line in open(thepropertyfile): strippedline = line.strip() if "=" in strippedline: key,value = line.strip().split('=', 1) properties[key] = value return properties
to get the value, do properties.get('bla')
No comments:
Post a Comment