Last active
August 31, 2018 00:50
-
-
Save mnguyenngo/a3bec3ae561ac09dc0e91d2e232dd76c to your computer and use it in GitHub Desktop.
Reading a yaml file
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 | |
with open("apikey.yaml", 'r') as f: | |
try: | |
credentials_dict = yaml.load(f) | |
except yaml.YAMLError as exc: | |
print(exc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment