class data_list: file_list = os.listdir(os.getcwd()) data_file = [] for i in file_list: if i.endswith('.js'): data_file.append(i) return data_file
I don’t know why this error is reported. May I ask what is wrong?
What you defined above is a classclass data_list, not a function.
class data_list
What you defined above is a class
class data_list
, not a function.