data_file = open(“F:\MyPro\data.yaml”, “r”, encoding=’utf-8’)
运行的时候报错:TypeError: ‘encoding’ is an invalid keyword argument for this function
网上查找一番后,改成如下这样就可以搞定
import io
data_file = io.open(“F:\MyPro\data.yaml”, “r”, encoding=’utf-8’)
data_file = open(“F:\MyPro\data.yaml”, “r”, encoding=’utf-8’)
运行的时候报错:TypeError: ‘encoding’ is an invalid keyword argument for this function
网上查找一番后,改成如下这样就可以搞定
import io
data_file = io.open(“F:\MyPro\data.yaml”, “r”, encoding=’utf-8’)