0

我没有成功修复我的代码上的这个错误。Python 给我写了这个错误信息:

"Traceback (most recent call last):
  File "C:\Users\Chloé CHAUMETON\Documents\BioAxial\1_R&D\4_Software\2_Python\Measurement_script\Matlab_to_Python\2019\Chloe_script_V3.py", line 114, in <module>
    if 0 < len((lrir)(lrir.name_file)):
AttributeError: 'function' object has no attribute 'name_file' "

我定义"name_file = 'BSR_Main.exe2018_09_14.csv' "了我的代码,但我不明白为什么 python 不将此名称 f 归因于函数。这是我的代码。

i_r=[]

def lrir():

lrir = liste_record[i_r]

name_file = 'BSR_Main.exe2018_09_14.csv';

for i_r in range(0,rec-1):

    if 0 < len((lrir)(lrir.name_file)):

        str1 = ligne.find(lrir.name_file,'/')
        pr_rep = os.path.join(dir_PR,s(i_r).name_file)
        log_rep = os.path.join(pr_rep,'Log')
        log_file = glob.glob(os.path.join(log_rep,'*.log'))
        print('log file:',log_file)
4

0 回答 0