newmiracle

python 读取字典文件的方法

 

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

命名dicfile

然后读取直接import

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

 

分类:

技术点:

相关文章: