Skip to content

Instantly share code, notes, and snippets.

@ehzawad
Created November 9, 2022 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehzawad/55515ffc66436f5e7c818e5b7b880ee3 to your computer and use it in GitHub Desktop.
Save ehzawad/55515ffc66436f5e7c818e5b7b880ee3 to your computer and use it in GitHub Desktop.
# 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