解决方法: pycharm 打开cfg文件配置高亮方法: setting->editor->file types, 在recognized file types,中找到ini,下面框添加*.cfg即可。 效果图: