一些好用的函数和类
Project description
一些好用的函数和类
1.配置文件
yaml_file yaml 格式的配置文件
config.yaml
config.yaml
host: localhost
port: 123
config.xlsx
测试代码
from l0n0lutils.files import *
config = simple_load_config(yaml_file)
print(config.get("host"))
print(config.get("port"))
config = simple_load_config(xl_file)
print(config.get(1))
print(config.get(2))
print(config.data)
config = simple_load_config(xl_kv_file)
print(config.get(1))
print(config.get(2))
print(config.data)
输出结果:
localhost
1234
{'id': 1, 'a': 'asdf', 'b': 1.2, 'c': 4}
{'id': 2, 'a': 'adsf', 'b': 2.2, 'c': 5}
{1: {'id': 1, 'a': 'asdf', 'b': 1.2, 'c': 4}, 2: {'id': 2, 'a': 'adsf', 'b': 2.2, 'c': 5}, 3: {'id': 3, 'a': 'fda', 'b': 3.2, 'c': 6}, 4: {'id': 4, 'a': 'dae', 'b': 4.2, 'c': 7}}
asdf
adsf
{'int': 'string', 1.0: 'asdf', 2.0: 'adsf', 3.0: 'fda', 4.0: 'dae'}
xl_file excel格式的配置文件
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
l0n0lutils-1.0.6.tar.gz
(11.9 kB
view hashes)
Built Distribution
l0n0lutils-1.0.6-py3-none-any.whl
(12.0 kB
view hashes)
Close
Hashes for l0n0lutils-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59b32cdc0298b0b2fa074cc28569794256deafcf9427585d35390a02084f5122 |
|
MD5 | 2a295b264c369dd58d5d7cbfefb4ab1c |
|
BLAKE2b-256 | 443b1b1558094d235542d75643bfa7bcd2d597ea3ffcc0ad1e2163b049c4309f |