1 Star 0 Fork 17

helloworld/mongodb_backup_script

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
properties_util.py 496 Bytes
一键复制 编辑 原始数据 按行查看 历史
hanxuetong 提交于 2016-07-14 21:14 . add
#!/usr/bin/env
class Properties:
fileName = ''
def __init__(self, fileName):
self.fileName = fileName
def getProperties(self):
try:
pro_file = open(self.fileName, 'r')
properties = {}
for line in pro_file:
if line.find('=') > 0 and line.find('#') < 0:
strs = line.replace('\n', '').split('=')
p_key=strs[0].strip()
p_value=strs[1].strip()
properties[p_key] = p_value
except Exception, e:
raise e
finally:
pro_file.close()
return properties
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/sunyunzhe/mongodb_backup_script.git
[email protected]:sunyunzhe/mongodb_backup_script.git
sunyunzhe
mongodb_backup_script
mongodb_backup_script
master

搜索帮助