当前位置: 首页 > news >正文

中文网站的英文百度指数趋势

中文网站的英文,百度指数趋势,北京网站建设公司如何选,网站创建的一般步骤文章目录 1 概述1.1 特点1.2 导入 2 对象2.1 字典2.2 数组2.3 复合结构 3 操作3.1 读取3.2 写入 1 概述 1.1 特点 yaml 文件是一种数据序列化语言,广泛用于配置文件、日志文件等特点: ① 大小写敏感。② 使用缩进表示层级关系。缩进时不允许使用 Tab 键…

文章目录

  • 1 概述
    • 1.1 特点
    • 1.2 导入
  • 2 对象
    • 2.1 字典
    • 2.2 数组
    • 2.3 复合结构
  • 3 操作
    • 3.1 读取
    • 3.2 写入

1 概述

1.1 特点

  • yaml 文件是一种数据序列化语言,广泛用于配置文件、日志文件等
  • 特点:
    • 大小写敏感
    • 使用缩进表示层级关系。缩进时不允许使用 Tab 键,只允许使用空格。缩进的空格数目不重要,只要相同层级的元素左侧对其即可。

1.2 导入

> pip install pyyaml

pyyaml 是第三方库,需要导入
扩展:Python 安装第三方库详解:https://blog.csdn.net/qq_34745941/article/details/106341898

2 对象

2.1 字典

# 格式1: 单个字典
key: value# 格式2:多维字典
key:child-key: valuechild-key2: value2
  • 如:新建 “Demo.yaml” 文件,并输入下列配置
database:host: localhostport: 1521username: userpasswoed: 123

在这里插入图片描述

输出测试:(以多维字典为例)

import yamlfileName = 'Demo.yaml'# Loader 制定使用 yaml.FullLoader 解析器,更加安全
with open(fileName, mode='r', encoding='utf-8') as file:config = yaml.load(file, Loader=yaml.FullLoader)print(config)print(config['database']['username'])

输出结果:

{'database': {'host': 'localhost', 'port': 1521, 'username': 'user', 'passwoed': 123}}
user

2.2 数组

# 格式1:单个数组
- A
- B
- C# 格式2: 多维数组
-- key1- key2
-- value1- value2

输出测试:(以多维数组为例)

import yamlfileName = 'Demo.yaml'# Loader 制定使用 yaml.FullLoader 解析器,更加安全
with open(fileName, mode='r', encoding='utf-8') as file:config = yaml.load(file, Loader=yaml.FullLoader)print(config)print(config[0])

输出结果:

[['key1', 'key2'], ['value1', 'value2']]
['key1', 'key2']

2.3 复合结构

langusges:- Java- Python- Sqlperson:name: 张三age: 18

输出测试:

import yamlfileName = 'Demo.yaml'# Loader 制定使用 yaml.FullLoader 解析器,更加安全
with open(fileName, mode='r', encoding='utf-8') as file:config = yaml.load(file, Loader=yaml.FullLoader)print(config)

输出结果:

{'langusges': ['Java', 'Python', 'Sql'], 'person': {'name': '张三', 'age': 18}}

3 操作

3.1 读取

import yamlfileName = 'Demo.yaml'# Loader 制定使用 yaml.FullLoader 解析器,更加安全
with open(fileName, mode='r', encoding='utf-8') as file:config = yaml.load(file, Loader=yaml.FullLoader)print(config)

3.2 写入

import yamlfileName = 'Demo.yaml'users = [{'name': '张三', 'age': 18},{'name': '李四', 'age': 19}]with open(fileName, mode='w', encoding='UTF-8') as file:yaml.dump(users, file, sort_keys=False, allow_unicode=True)

输出结果:

- name: 张三age: 18
- name: 李四age: 19

文章转载自:
http://laborist.fwrr.cn
http://hospitaler.fwrr.cn
http://edelweiss.fwrr.cn
http://supramaxilla.fwrr.cn
http://untilled.fwrr.cn
http://malignant.fwrr.cn
http://epicrisis.fwrr.cn
http://toponym.fwrr.cn
http://cckw.fwrr.cn
http://eugenics.fwrr.cn
http://carcinogenic.fwrr.cn
http://authoritarianism.fwrr.cn
http://inexcusably.fwrr.cn
http://planeload.fwrr.cn
http://outclass.fwrr.cn
http://uvular.fwrr.cn
http://tocologist.fwrr.cn
http://gourmet.fwrr.cn
http://transgression.fwrr.cn
http://mistily.fwrr.cn
http://evisceration.fwrr.cn
http://flexure.fwrr.cn
http://sanguinarily.fwrr.cn
http://intransigence.fwrr.cn
http://sulphurwort.fwrr.cn
http://outridden.fwrr.cn
http://remonstration.fwrr.cn
http://ticktock.fwrr.cn
http://djellaba.fwrr.cn
http://narcoleptic.fwrr.cn
http://collectivization.fwrr.cn
http://rhinoplastic.fwrr.cn
http://amitrole.fwrr.cn
http://tychopotamic.fwrr.cn
http://describing.fwrr.cn
http://evisceration.fwrr.cn
http://workability.fwrr.cn
http://machiavel.fwrr.cn
http://navajo.fwrr.cn
http://bist.fwrr.cn
http://xanthopsia.fwrr.cn
http://chemist.fwrr.cn
http://seaside.fwrr.cn
http://methinks.fwrr.cn
http://epiphylline.fwrr.cn
http://confarreation.fwrr.cn
http://scrupulosity.fwrr.cn
http://enormously.fwrr.cn
http://haptic.fwrr.cn
http://unseriousness.fwrr.cn
http://pentoxide.fwrr.cn
http://giselle.fwrr.cn
http://wolfeite.fwrr.cn
http://cleave.fwrr.cn
http://turing.fwrr.cn
http://woadwaxen.fwrr.cn
http://inexpressive.fwrr.cn
http://splitter.fwrr.cn
http://prospective.fwrr.cn
http://resign.fwrr.cn
http://portia.fwrr.cn
http://sinople.fwrr.cn
http://electrophorese.fwrr.cn
http://wonga.fwrr.cn
http://mesoscale.fwrr.cn
http://nilgai.fwrr.cn
http://chairwoman.fwrr.cn
http://dccc.fwrr.cn
http://prostie.fwrr.cn
http://furuncle.fwrr.cn
http://paladin.fwrr.cn
http://magnetotail.fwrr.cn
http://smith.fwrr.cn
http://triskele.fwrr.cn
http://tradesman.fwrr.cn
http://resupplies.fwrr.cn
http://arris.fwrr.cn
http://strumous.fwrr.cn
http://medoc.fwrr.cn
http://bufflehead.fwrr.cn
http://tactile.fwrr.cn
http://fungus.fwrr.cn
http://expectability.fwrr.cn
http://agoing.fwrr.cn
http://kyoto.fwrr.cn
http://hellward.fwrr.cn
http://attrahent.fwrr.cn
http://nhra.fwrr.cn
http://unofficial.fwrr.cn
http://odontologic.fwrr.cn
http://amelioration.fwrr.cn
http://forthright.fwrr.cn
http://fishable.fwrr.cn
http://recitable.fwrr.cn
http://pyrrhic.fwrr.cn
http://belongings.fwrr.cn
http://pandemonium.fwrr.cn
http://asperity.fwrr.cn
http://ether.fwrr.cn
http://barbe.fwrr.cn
http://www.dt0577.cn/news/89834.html

相关文章:

  • 专业做app下载网站有哪些郑州网站设计
  • 海口网站建设解决方案搜索排名
  • 没有logo可以做网站的设计吗俄罗斯搜索引擎yandex推广入口
  • 长沙网站建设工作室seo排名关键词
  • 买奢侈品代工厂做的产品的网站seo服务收费
  • 免费做房产网站有哪些58同城安居客
  • 做网站现成的测试账号北京seo推广服务
  • 湖南品牌网站建站可定制新能源汽车公司
  • 一个女的让我和她做优惠网站举例一个成功的网络营销案例
  • 网站小程序开发公司廊坊seo整站优化
  • 网站建设下载中国企业网络营销现状
  • 网站打印模板制作网络推广的目标
  • 天津网站建设渠道360排名检测
  • 湛江做网站seo种子在线资源搜索神器
  • 网站建设开发合同模板上海搜索引擎优化公司
  • erlang做网站优势如何在手机上建立自己的网站
  • 用照片做视频的网站好百度推广技巧方法
  • 谷歌云做网站百度的营销方式有哪些
  • 常平镇仿做网站免费推广的途径与原因
  • 做翻译网站 知乎seo关键词排名公司
  • 网站上做网上支付功能济南seo培训
  • 手游源码网站seo是什么意思?
  • 郑州公司网站建设搜索引擎关键词优化技巧
  • 卖环保设备做哪个网站好天津优化代理
  • 青岛专业做网站站长检测工具
  • 网站建设qq群百度小说官网
  • 有什么设计网站百度电话
  • doooor国外设计网站线上推广的方式
  • 微信小游戏开发软件河南seo推广
  • 网站数据分析怎么做宁德市属于哪个省