No project description provided
Project description
安装 pip install pr-properties
这是一个读写properties工具
from pr_properties import pr_properties
# 读写properties文件
p = pr_properties.read(r'./pool.properties') # p = PropertiesHandler(r"./pool.properties").read()
print(p['master.initialSize']) # 4
# 支持get
print(p.get('master.initialSize'))
# 修改
p['master.initialSize'] = 5
# 写入,写入后会关闭文件;写入功能请慎重使用
p.write()
p.read(r'./pool.properties')
# 验证是否修改
print(p['master.initialSize']) # 5
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pr_properties-1.8.2.tar.gz
(15.7 kB
view hashes)
Built Distribution
Close
Hashes for pr_properties-1.8.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb3b7c3475517b63e27a50821b40a3aa603c0476d14770537bf6d25d50ff2331 |
|
MD5 | 670508ec06faa7cafa9db0cdd21bf423 |
|
BLAKE2b-256 | 3bcc8a956b6f2d7cff633ea3a2948cc9b7c856ecd027b5dcb43ff330aa89bb27 |