当前位置:网站首页>Addition, deletion, modification and query of ymal file
Addition, deletion, modification and query of ymal file
2022-06-27 01:40:00 【xxs!】
yaml Introduce :
A data format , Support comments , Line break , Multiline string
Way of use :
Generally, it can be used as a configuration file (conf file ) Record account information , Environmental Science , database , Interface related parameters, etc
Usage method :
1、 Read yaml file
import yaml
""" Read configuration file """
with open(read_path() + "/conf/config.yaml") as f:
data = yaml.safe_load(f)
return data
2、 modify yaml Data in the file
with open(read_path() + "/conf/config.yaml", 'w') as f:
yaml.dump(data, f, default_flow_style=False)
3、 newly added yaml Data in the file
with open(read_path() + "/conf/config.yaml", "a") as f:
yaml.dump(desired_caps, f)
边栏推荐
- uvm中的config机制方法总结(一)
- buuctf-pwn write-ups (6)
- TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘
- Is it safe to open a securities account online? Is it reliable to speculate in stocks by mobile phone
- Memcached foundation 1
- Interface isolation principle
- Keepalived 实现 Redis AutoFailover (RedisHA)15
- Ymal文件的增删改查
- memcached基础5
- Memcached foundation 3
猜你喜欢

JVM 的指针压缩

IIS 部署静态网站和 FTP 服务

简单学习GoogleColab的入门级概念
![Find the minimum value in the rotation sort array ii[classical Abstract dichotomy + how to break the game left, middle and right are equal]](/img/75/05d5765588dfde971167fbc72e2aa8.png)
Find the minimum value in the rotation sort array ii[classical Abstract dichotomy + how to break the game left, middle and right are equal]

Analysis of ideal L9 product power: the price is 459800 yuan, the four cylinder engine is adopted, and the endurance is 1315km

30《MySQL 教程》MySQL 存储引擎概述

getReader() has already been called for this request

Continuous delivery blue ocean application

在线文本数字识别列表求和工具

XSS notes (Part 2)
随机推荐
buuctf-pwn write-ups (6)
福元医药上市在即:募资净额将达到16亿元,胡柏藩为实际控制人
UVM中uvm_config_db在sequence中的使用
memcached基础3
Memcached foundation 5
get_ Usage Summary of sequencer
为什么先划分训练集和测试集后归一化?
Systematic analysis of social networks using Networkx: Facebook network analysis case
IIS deploy static web site and FTP service
清华&智源 | CogView2:更快更好的文本图像生成模型
numpy 数组运算机制浅探
Meituan: data management and pit avoidance strategy summarized after stepping on Thunder for several years
snakemake 使用的注意事项
The most difficult 618 in history, TCL won the first place in both jd.com and tmall.com shares in the TV industry
Encapsulation of unified result set
自定义类加载器对类加密解密
[the path of system analyst] Chapter 6: duplicate demand engineering (case paper)
UVM中uvm_config_db非直线的设置与获取
Did your case really pass?
Interface isolation principle