Python 打开文件的TDMS用法

Python 打开文件的TDMS用法,python,Python,我正在使用tdms在我的代码中打开一个文件 def load_specfile_Spectra(self): # Tdms-File oeffnen tdms_file = TdmsFile(self.specfilename) # get num_cols and num_rows from text-file header = tdms_file.object() self.x_label = "Pixel" # Writ

我正在使用tdms在我的代码中打开一个文件

def load_specfile_Spectra(self):
    # Tdms-File oeffnen
    tdms_file = TdmsFile(self.specfilename)
    # get num_cols and num_rows from text-file
    header = tdms_file.object()
    self.x_label = "Pixel"

    # Write data from channel into spec-matrix
    if ('RAMAN Sample Data' in tdms_file.groups()):
        channel = tdms_file.group_channels("RAMAN Sample Data")
        self.num_col = int(header.property("Schrittanzahl_X")) + 1
        self.num_row = int(header.property("Schrittanzahl_Y")) + 1
        x_values = tdms_file.group_channels("x-Werte")
当我运行整个应用程序时,我得到以下错误

Tkinter回调回溯中出现异常(最近一次调用最后一次):
文件“C:\Users\shiva\anaconda3\lib\tkinter\u init\uuuz.py”,第1883行,在 呼叫 返回self.func(*args)文件“C:/Users/shiva/PycharmProjects/pythonProject2/JuliaSi-imageprocessing02-129e80fcd48f/cpmigeru Python3.py”, 第478行,在cmd\u load\u specfile中 self.load_specfile_Spectra()文件“C:/Users/shiva/PycharmProjects/pythonProject2/JuliaSi-imageprocessing02-129e80fcd48f/cpmigrager_Python3.py”, 第593行,加载规格文件中 channel=tdms\u file.group\u channels(“示例数据”)AttributeError:'TdmsFile'对象没有属性'group\u channels'

我如何解决这个问题