12306/config/ticketConf.py

20 lines
373 B
Python
Raw Normal View History

2018-01-07 01:54:36 +00:00
# -*- coding: utf8 -*-
__author__ = 'MR.wen'
import os
import yaml
2018-01-20 15:27:24 +00:00
2018-01-07 01:54:36 +00:00
def _get_yaml():
"""
解析yaml
:return: s 字典
"""
path = os.path.join(os.path.dirname(__file__) + '/ticket_config.yaml')
f = open(path)
s = yaml.load(f)
f.close()
2019-01-07 09:48:41 +00:00
return s.decode() if isinstance(s, bytes) else s
if __name__ == '__main__':
print(_get_yaml())