python 2.7 问题
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')
2024-03-25 11:10:04
python 2.7 问题
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')