1
2つのpythonスクリプトを使用して '.obj'ファイルを開こうとしていますが、プロジェクトをコンパイルしようとすると次のエラーメッセージが表示されます:UnicodeDecodeError:cp932コーデックは81のバイト0x81をデコードできません
UnicodeDecodeError: cp932' codec can't decode byte 0x81 in position 81: illegal multibyte sequence
私のコードは次のようになります。
CarString = 'volks.obj'
global car
global objects
obj = test3.object()
car = obj.load_obj(CarString)
objects.append(glGenLists(1))
Classオブジェクト:
class object():
def __init__(self, obj = None):
if obj:
self.load_obj(obj)
#self.displaylist = self.crear_dl()
def load_obj(self, file):
with open(file, 'r') as obj:
data = obj.read()
data = obj.read()
部分は私にこのエラーを投げます。私はPythonを初めて使うので、これを修正するためにいくつかの助けを使うことができます。ありがとう。