Code

Code

Software crafts

  • Category
    • code10
    • getting-started1
    • gist3
    • operations4
  • Tag
    • aggregation1
    • c1
    • cron1
    • docker6
    • flask1
    • ghost1
    • js4
    • mongodb1
    • nginx1
    • node3
    • python7
    • socket.io2
    • solr2
    • terraform1
  • Archive
    • 20222
    • 20213
    • 20201
    • 201912
  • Home
  • By Year
  • milnomada.org
  • Github
  • RSS

Rich post

2019-11-15
  • code
  • python

The following snippet loads a yml file:

Load_configPyyaml
1
2
3
4
5
6
7
8
import yaml

def load_config():
with open(BASE_DIR + "/config.yml", 'r') as ymlfile:
cfg = yaml.load(ymlfile)
return cfg

return None
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
© 2025 Code - Powered by Hexo - Theme Chan