"PyYAML"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
3번째 줄: 3번째 줄:
* 파이썬用 YAML 파서(parser) 및 방출기(emitter)
* 파이썬用 YAML 파서(parser) 및 방출기(emitter)


<source lang='python'>
<syntaxhighlight lang='python'>
import yaml
import yaml
with open("example.yaml", 'r') as stream:
with open("example.yaml", 'r') as stream:
10번째 줄: 10번째 줄:
     except yaml.YAMLError as e:
     except yaml.YAMLError as e:
         print(e)
         print(e)
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2022년 1월 8일 (토) 02:08 판

1 개요

PyYAML
  • 파이썬用 YAML 파서(parser) 및 방출기(emitter)
import yaml
with open("example.yaml", 'r') as stream:
    try:
        print(yaml.safe_load(stream))
    except yaml.YAMLError as e:
        print(e)

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}