python
pip install PyYAML
python
import yaml
python
with open('config.yml', 'r') as file:
data = yaml.load(file, Loader=yaml.FullLoader)
print(data)
python
data = {'name': 'John', 'age': 30, 'city': 'New York'}
with open('config.yml', 'w') as file:
yaml.dump(data, file)
python
import yaml
with open('config.yml', 'r') as file:
data = yaml.load(file, Loader=yaml.FullLoader)
print(data)
data = {'name': 'John', 'age': 30, 'city': 'New York'}
with open('config.yml', 'w') as file:
yaml.dump(data, file)