当前位置:网站首页>Ymal文件的增删改查
Ymal文件的增删改查
2022-06-27 01:21:00 【xxs!】
yaml介绍:
一种数据格式,支持注释,换行,多行字符串
使用途径:
一般可以在作为配置文件使用(conf文件)记录账号信息,环境,数据库,接口的关联参数等
使用方法:
1、读取yaml文件
import yaml
"""读取配置文件"""
with open(read_path() + "/conf/config.yaml") as f:
data = yaml.safe_load(f)
return data
2、修改yaml文件中数据
with open(read_path() + "/conf/config.yaml", 'w') as f:
yaml.dump(data, f, default_flow_style=False)
3、新增yaml文件中数据
with open(read_path() + "/conf/config.yaml", "a") as f:
yaml.dump(desired_caps, f)
边栏推荐
- memcached基础
- Keepalived 实现 Redis AutoFailover (RedisHA)13
- 30《MySQL 教程》MySQL 存储引擎概述
- Analysis of ideal L9 product power: the price is 459800 yuan, the four cylinder engine is adopted, and the endurance is 1315km
- Esp32 add multi directory custom component
- Memcached foundation 7
- Count the logarithm of points that cannot reach each other in an undirected graph [classic adjacency table building +dfs Statistics - > query set optimization] [query set manual / write details]
- Custom class loader encrypts and decrypts classes
- 3线spi屏幕驱动方式
- 【毕业季】角色转换
猜你喜欢

The listing of Fuyuan pharmaceutical is imminent: the net amount raised will reach 1.6 billion yuan, and hubaifan is the actual controller

30 MySQL tutorial MySQL storage engine overview

解决unable to create a folder to save the sketch: mkdir sketch

Processing of slice loss in ArcGIS mosaic dataset

清华&智源 | CogView2:更快更好的文本图像生成模型

史上最难618,TCL夺得电视行业京东和天猫份额双第一

getReader() has already been called for this request
![Custom jsp[if, foreach, data, select] tag](/img/a2/fc75c182d572d86f4466323e31d6c3.png)
Custom jsp[if, foreach, data, select] tag

【毕业季】角色转换

C#程序结构预览最基础入门
随机推荐
How to measure the thickness of glass substrate by spectral confocal
Unable to create a folder to save the sketch: MKDIR sketch
Custom jsp[if, foreach, data, select] tag
Database interview questions +sql statement analysis
memcached基础4
SystemVerilog仿真速率提升
uvm中的config机制方法总结(二)
Keepalived 实现 Redis AutoFailover (RedisHA)14
The listing of Fuyuan pharmaceutical is imminent: the net amount raised will reach 1.6 billion yuan, and hubaifan is the actual controller
JSON parsing, esp32 easy access to time, temperature and weather
在线文本数字识别列表求和工具
memcached基础2
Amazon ElastiCache 飞速搭建缓存服务集群,这才叫快
30《MySQL 教程》MySQL 存储引擎概述
每日刷题记录 (五)
Interface test framework practice (I) | requests and interface request construction
3線spi屏幕驅動方式
Kept to implement redis autofailover (redisha) 12
疫情期间居家办公的总结体会 |社区征文
One click acceleration of Sony camera SD card file copy operation, file operation batch processing tutorial