Properties file in python (similar to Java Properties)

后端 未结 25 2787
故里飘歌
故里飘歌 2020-11-29 17:41

Given the following format (.properties or .ini):

propertyName1=propertyValue1
propertyName2=propertyValue2
...
propertyNam         


        
25条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 18:45

    i have used this, this library is very useful

    from pyjavaproperties import Properties
    p = Properties()
    p.load(open('test.properties'))
    p.list()
    print(p)
    print(p.items())
    print(p['name3'])
    p['name3'] = 'changed = value'
    

提交回复
热议问题