In general, I am trying to read the .trc file. I decided to use the answer from the question .trc extension. How to read and display correctly in Open_GL?
"There is a python project github.com/yetifrisstlama/readTrc - Cerbo 13 Apr at 6:21"
But when it starts, it complains to me and gives an error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 18: ordinal not in range(128) .
# -*- coding: utf-8 -*- """ # -*- coding: cp1251 -*- Little helper function to load data from a .trc binary file. This is the file format used by LeCroy oscilloscopes. M. Betz 09/2015 """ #form __fiture__ import with_statement #для питон 2.5 import datetime import numpy as np import struct print 1 fName = "Newfile1a.trc"; with open(fName, "rb") as fid: #data = fid.read(50).encode() data = fid.read(50).decode() wdOffset = data.find('WAVEDESC') print 2 P.S. Spyder (IDE) is very good, is there any similar crap on Qt 4.8 ?????
decodeto specify the encoding of your file. And always lay out the full stack, and not just the error message itself - I almost suggested adding the encoding attribute in open until I noticed that therbmode was gil9reddecode()specify different encodings until the error disappears. Try utf-8 or latin1 - gil9red