当前位置:网站首页>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)
边栏推荐
- Flutter series: flow in flutter
- 可视化介绍 Matplotlib 和 Plotnine
- memcached基础6
- 世界很大,有人把二维码纹在脖子上
- Esp32 experiment - self built web server distribution network 02
- TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘
- NLP: brief introduction of transformer in NLP natural language field (pre training technology), NLP model development (elmo/gpt/bert/mt-dnn/xlnet/roberta/albert), detailed introduction to classic case
- 美团:踩雷好几年,才总结出的数据治理避坑攻略
- XSS notes (Part 2)
- CLIP:从自然语言监督中学习可迁移的视觉模型
猜你喜欢

通过Rust语言计算加速技术突破图片识别性能瓶颈

Gaussian and Summary Stats

3-wire SPI screen driving mode

Hid device descriptor and keyboard key value corresponding coding table in USB protocol

Amazon elasticache quickly builds a cache service cluster, which is fast

可视化介绍 Matplotlib 和 Plotnine

ArcGIS 镶嵌数据集切片丢失问题处理

1.44寸TFT-LCD显示屏取模教程

Central Limit Theorem

Central Limit Theorem
随机推荐
大白话高并发(一)
UVM中uvm_config_db在sequence中的使用
Solve the problem that stc8g1k08 program cannot run and port configuration
The most difficult 618 in history, TCL won the first place in both jd.com and tmall.com shares in the TV industry
Analysis of ideal L9 product power: the price is 459800 yuan, the four cylinder engine is adopted, and the endurance is 1315km
Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
Encapsulation of unified result set
Hid device descriptor and keyboard key value corresponding coding table in USB protocol
Custom class loader encrypts and decrypts classes
Keepalived 实现 Redis AutoFailover (RedisHA)12
Object access mechanism and others
持续交付-Blue Ocean 应用
Ml: a detailed introduction to the division of the top ten roles, backgrounds, responsibilities and outputs of the machine learning engineering team
ArcGIS 镶嵌数据集切片丢失问题处理
Meituan: data management and pit avoidance strategy summarized after stepping on Thunder for several years
Beyond lithium battery -- the concept of battery in the future
buuctf-pwn write-ups (6)
Memcached foundation 5
Memcached foundation 1
乔治·华盛顿大学 : Hanhan Zhou | PAC:多智能体强化学习中具有反事实预测的辅助价值因子分解