使用前安装 PyYaml 包
read_yaml.yaml
first_name: 111
second_name: 222
third_name: 333
basic_name:
test_name: 444
selected_name:
- 666
- 777
read_yaml.py
# -*- coding:utf-8 -*-
import os
import yaml
current_path = os.path.abspath(os.path.dirname(__file__))
print(current_path)
print(current_path + '/../test_dir')
with open(current_path + '/../test_dir/' + 'read_yaml.yaml', 'r') as f:
temp = yam