当前位置:网站首页>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)
边栏推荐
- Kept to implement redis autofailover (redisha) 17
- Weibo comments on high performance and high availability architecture
- 在 IDEA 里看个书很过分嘛!
- IIS deploy static web site and FTP service
- Ymal文件的增删改查
- Keepalived 实现 Redis AutoFailover (RedisHA)14
- Bootstrapblazor + FreeSQL actual combat chart usage (2)
- Buuctf PWN write UPS (6)
- 架构实战营模块五作业
- 30 MySQL tutorial MySQL storage engine overview
猜你喜欢
JSON parsing, esp32 easy access to time, temperature and weather
ML:机器学习工程化之团队十大角色背景、职责、产出物划分之详细攻略
Meituan: data management and pit avoidance strategy summarized after stepping on Thunder for several years
buuctf-pwn write-ups (6)
How to measure the thickness of glass substrate by spectral confocal
理想L9产品力分析:售价45.98万,采用四缸发动机,续航1315公里
CLIP:从自然语言监督中学习可迁移的视觉模型
学习DiscoDiffusion的最基础操作
Browser cache
Esp32 add multi directory custom component
随机推荐
XSS notes (Part 2)
How to measure the thickness of glass substrate by spectral confocal
flutter系列之:flutter中的flow
Custom jsp[if, foreach, data, select] tag
接口测试框架实战(一) | Requests 与接口请求构造
Amazon ElastiCache 飞速搭建缓存服务集群,这才叫快
leetcode 1143. Longest Commom Subsequence 最长公共子序列(中等)
Markdown table (consolidated)
Amazon elasticache quickly builds a cache service cluster, which is fast
通过Rust语言计算加速技术突破图片识别性能瓶颈
cookie,sessionstorage,localstorage区别
Two days of beautiful butterfly animation
简单学习GoogleColab的入门级概念
The world is very big. Some people tattoo QR codes on their necks
snakemake 使用的注意事项
Meituan: data management and pit avoidance strategy summarized after stepping on Thunder for several years
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]
Recursion will make strtok more attractive
getReader() has already been called for this request
Summary of working at home during the epidemic | community essay solicitation