Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- ASP
- Excel
- Unity
- 날짜
- 다이어트
- PER
- ubuntu
- swift
- python
- urllib
- IOS
- PyQt5
- pandas
- tensorflow
- MySQL
- 리눅스
- mssql
- node.js
- 함수
- flutter
- GIT
- 라즈베리파이
- MS-SQL
- Linux
- 유니티
- PyQt
- 맛집
- port
- javascript
- sqlite
Archives
아미(아름다운미소)
Yml 본문
import yaml
# YAML 파일 로드
with open('config.yml') as f:
config = yaml.safe_load(f)
# 값 접근
print(config['app']['name']) # "My Awesome App"
print(config['database']['production']['credentials']['username']) # "admin"
# 리스트 항목 접근
for feature in config['app']['features']:
print(feature)
app:
name: "My Awesome App"
version: 2.3.1
features:
- "authentication"
- "data_export"
- "notifications"
settings:
cache_enabled: true
max_retries: 3
allowed_file_types: [".jpg", ".png", ".pdf"]
Comments