python 读取字典文件的方法

python 读取字典文件的方法

 

dic = {
    'age': 23,
    'city': 'beijing',
    'skill': 'python'
}

命名dicfile

然后读取直接import

import dicfile
print(dicfile.dic['age'])

 

posted @ 2021-10-27 11:14  newmiracle宇宙  阅读(1683)  评论(0编辑  收藏  举报