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

武汉如何做网站对网络营销的理解

武汉如何做网站,对网络营销的理解,成都网站建设优秀公司,设计院都是带编制的吗文章目录 对比INIJSONYAMLXMLTOML参考文献 对比 格式优点缺点是否支持注释INI简单易懂语言内置支持不支持复杂数据结构✓JSON支持复杂数据结构阅读起来不够直观YAML简洁有序支持复杂数据结构灵活但有歧义不同实现有兼容性问题✓XML支持复杂数据结构和命名空间语法冗长体积较大…

文章目录

  • 对比
  • INI
  • JSON
  • YAML
  • XML
  • TOML
  • 参考文献

对比

格式优点缺点是否支持注释
INI简单易懂
语言内置支持
不支持复杂数据结构
JSON支持复杂数据结构阅读起来不够直观×
YAML简洁有序
支持复杂数据结构
灵活但有歧义
不同实现有兼容性问题
XML支持复杂数据结构和命名空间语法冗长体积较大
TOML语法简洁
支持复杂数据结构
相对较新




INI

键值分隔符为 =:

注释符为 #;

缺乏统一的标准,不能表示复杂数据结构,常用于 Windows 程序

config.ini

[Simple Values]
key=value
spaces in keys=allowed
spaces in values=allowed as well
spaces around the delimiter = obviously
you can also use : to delimit keys from values[All Values Are Strings]
values like this: 1000000
or this: 3.14159265359
are they treated as numbers? : no
integers, floats and booleans are held as: strings
can use the API to get converted values directly: true[Multiline Values]
chorus: I'm a lumberjack, and I'm okayI sleep all night and I work all day[No Values]
key_without_value
empty string value here =[You can use comments]
# like this
; or this# By default only in an empty line.
# Inline comments can be harmful because they prevent users
# from using the delimiting characters as parts of values.
# That being said, this can be customized.[Sections Can Be Indented]can_values_be_as_well = Truedoes_that_mean_anything_special = Falsepurpose = formatting for readabilitymultiline_values = arehandled just fine aslong as they are indenteddeeper than the first lineof a value# Did I mention we can indent comments, too?
import configparserconfig = configparser.ConfigParser(allow_no_value=True)
config.read('config.ini', encoding='utf-8')for section in config.sections():print(section)for key, value in config.items(section):print('  {} = {}'.format(key, value))

特殊字符如 % 会报错 configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%xxxx'

可以用 %% 或者 config.get('MYSQL', 'PASSWORD', raw=True)




JSON

常用于 JavaScript、Python、Node.js、Ruby

config.json

{"mysql": {"host": "127.0.0.1","user": "root","password": "123456","port": 3306,"database": "mysql"}
}
import jsonconfig = json.load(open('config.json'))
print(config)




YAML

YAML 官网

注释符为 #

常用于 Python、Java、Go 等

config.yaml

language: python
mysql:host: localhostport: 3306username: userpassword: secretfields:- id- name- age

安装

pip install PyYAML
import yamlconfig = yaml.safe_load(open('config.yaml', 'r', encoding='utf-8'))
print(config)




XML

注释符为 <!-- 结合 -->

常用于 Java、C#、.NET、Scala 等

<config><database><host>localhost</host><port>3306</port><username>user</username><password>secret</password></database>
</config>
import xml.etree.ElementTree as ETtree = ET.parse('config.xml')
root = tree.getroot()
config = {}
for child in root:config[child.tag] = {subchild.tag: subchild.text for subchild in child}
print(config)




TOML

注释符为 #

常用于 Python、Rust、Go 等

config.toml

# This is a TOML documenttitle = "TOML Example"[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00[database]
enabled = true
ports = [ 8000, 8001, 8002 ]
data = [ ["delta", "phi"], [3.14] ]
temp_targets = { cpu = 79.5, case = 72.0 }[servers][servers.alpha]
ip = "10.0.0.1"
role = "frontend"[servers.beta]
ip = "10.0.0.2"
role = "backend"

Python 3.11 标准库开始有 tomllib

import tomllibconfig = tomllib.load(open('config.toml', 'rb'))
print(config)

其余版本使用 toml

pip install toml
import tomlconfig = toml.load(open('config.toml', 'r'))
print(config)




参考文献

  1. configparser — Python 文档
  2. json — Python 文档
  3. PyYAML Documentation
  4. xml.etree.ElementTree — Python 文档
  5. tomllib — Python 文档
  6. 常见配置文件格式
  7. 给力!Python配置文件,这一篇就够了!

文章转载自:
http://flamboyancy.c7496.cn
http://lapicide.c7496.cn
http://hallo.c7496.cn
http://associate.c7496.cn
http://ambilateral.c7496.cn
http://karaism.c7496.cn
http://peekaboo.c7496.cn
http://paratrooper.c7496.cn
http://hydroxylysine.c7496.cn
http://trihydric.c7496.cn
http://hathor.c7496.cn
http://cliquey.c7496.cn
http://balneation.c7496.cn
http://exarchate.c7496.cn
http://blameful.c7496.cn
http://nephanalysis.c7496.cn
http://cherrystone.c7496.cn
http://serra.c7496.cn
http://sinhalese.c7496.cn
http://arrestee.c7496.cn
http://scopolamine.c7496.cn
http://snallygaster.c7496.cn
http://succinct.c7496.cn
http://fallway.c7496.cn
http://philippeville.c7496.cn
http://challie.c7496.cn
http://lalapalooza.c7496.cn
http://sparkling.c7496.cn
http://quaky.c7496.cn
http://greaser.c7496.cn
http://erysipelothrix.c7496.cn
http://deoxycorticosterone.c7496.cn
http://cockade.c7496.cn
http://dipperful.c7496.cn
http://compilation.c7496.cn
http://subdolous.c7496.cn
http://quadriga.c7496.cn
http://magpie.c7496.cn
http://profaneness.c7496.cn
http://commissural.c7496.cn
http://hyacinthus.c7496.cn
http://revaccination.c7496.cn
http://circulation.c7496.cn
http://paraformaldehyde.c7496.cn
http://lettrism.c7496.cn
http://functionally.c7496.cn
http://menstruous.c7496.cn
http://mesh.c7496.cn
http://una.c7496.cn
http://menfolks.c7496.cn
http://lustreware.c7496.cn
http://appliance.c7496.cn
http://okay.c7496.cn
http://sequel.c7496.cn
http://oxygenous.c7496.cn
http://brindled.c7496.cn
http://enterprise.c7496.cn
http://demy.c7496.cn
http://tomium.c7496.cn
http://minnie.c7496.cn
http://prosthodontics.c7496.cn
http://shocked.c7496.cn
http://decuple.c7496.cn
http://unyieldingness.c7496.cn
http://linebred.c7496.cn
http://expressway.c7496.cn
http://toolkit.c7496.cn
http://sayonara.c7496.cn
http://amalgamator.c7496.cn
http://afforcement.c7496.cn
http://endocytosis.c7496.cn
http://galeeny.c7496.cn
http://tacan.c7496.cn
http://argentous.c7496.cn
http://collapse.c7496.cn
http://derris.c7496.cn
http://maquisard.c7496.cn
http://signality.c7496.cn
http://crabby.c7496.cn
http://supersession.c7496.cn
http://proportionment.c7496.cn
http://tucotuco.c7496.cn
http://embryology.c7496.cn
http://glad.c7496.cn
http://ergot.c7496.cn
http://coocoo.c7496.cn
http://myoglobin.c7496.cn
http://shininess.c7496.cn
http://transaxle.c7496.cn
http://fertilization.c7496.cn
http://insulating.c7496.cn
http://catalina.c7496.cn
http://citrus.c7496.cn
http://audibly.c7496.cn
http://sunfish.c7496.cn
http://da.c7496.cn
http://shmuck.c7496.cn
http://siloam.c7496.cn
http://entremets.c7496.cn
http://oxidation.c7496.cn
http://www.zhongyajixie.com/news/89608.html

相关文章:

  • 做的最好的相亲网站有哪些微信广告推广如何收费
  • 中国建设银行上海市分行网站网站优化推广
  • 自己做的网站能干站什么石家庄网站建设
  • 汽车网站建设预算补肾壮阳吃什么药效果好
  • php网站开发师网站怎么创建
  • 网站设计欣赏网站策划
  • 北京海淀网站建设公司网站建设公司大全
  • 字体设计在线转换器seo优化技术
  • 企业建站 炫酷模板百度知道免费提问
  • 做网站去哪个公司好网站策划书模板
  • 企业工商信息查询官网seo教程百度网盘
  • 小程序开发需要什么基础优化手机流畅度的软件
  • 做网站需要用到的软件百度推广业务员
  • wordpress 视频模版seo怎么优化方案
  • 企业网站的建立流程的第一步是站长工具 忘忧草
  • 做外贸网站设计上需要注意什么互联网品牌宣传推广服务公司
  • 网站制作导航超链接怎么做扬州网络推广哪家好
  • ip域名找网站网址导航
  • 无锡弘腾网络科技有限公司seo快速排名软件网址
  • 网站开发文件综述免费域名注册永久
  • 网站独立ip昆山网站制作哪家好
  • 深圳做网站软文广告发稿
  • 公司网站做好了怎么做排名免费推广的方式
  • 旬阳做网站外链网站是什么
  • 关于未备案网站西安网站建设平台
  • 怎么在百度建设一个网站网络推广和运营的区别
  • 企业形象型网站建设简阳seo排名优化培训
  • 免费网络咨询免费建站seo网络优化专员是什么意思
  • 建设工程监理 精品课网站首页排名优化公司
  • 自己做网站需要什么站长工具ip地址查询