Created
November 9, 2022 09:02
-
-
Save ehzawad/55515ffc66436f5e7c818e5b7b880ee3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import yaml | |
# from yaml.loader import SafeLoader | |
# | |
# with open('userdetail.yaml') as f: | |
# data = yaml.load(f, Loader=SafeLoader) | |
# print(data) | |
# | |
import sys | |
from ruamel.yaml import YAML | |
with open('userdetail.yaml') as f: | |
data = YAML().load(f) | |
data['phone'] = '0123244324234324' | |
print(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment