YAML
Overview: it is an intuitive data serialization format that can be recognized by computers.
In YAML, the structure is represented by indentation, and consecutive items are represented by minus signs "-". The key/value pairs in the map structure are separated by colons.
YAML can also be used to describe the abbreviation Syntax of several lines of data with the same structure. arrays are included with '[]', and hash is included.
Example:
[Python]
Root:
Urls:
-{Name: chen, age: 22} # add space to the short horizontal bar, followed by a space followed by the colon, which will generate a format similar to: urls: [xxx, yyy]
-[1, 2, 3, 4]
Database:
Oracle:
Host: loacalhost
User: root
Passwd: root
Db: name2ip
Mysql:
Host: localhost
User: root
Passwd: root
Db: name2ip
Usage:
[Python]
Import yaml
F = open ('test. yaml ')
X = yaml. load (f)
X is the resolved list or dist, which can be accessed using the sequential access method.
OK, simple and clear yaml!