我很抱歉,但我刚开始使用Python,但我在下面的代码未解决的参考get_func()错误:悬而未决参考get_func()在pycharm
class Foo:
fo = open(file_name, "r")
with open(file_name, 'r') as file:
examples = int(file.readline())
attributes = int(file.readline())
name_of_attributes = [n for n in (file.readline().replace(" ", "")).split(",")]
all_examples = file.readlines()
get_func(); // error here
def get_func(self):
list_of_keys = ['S_Length', 'S_Width', 'P_Length', 'P_Width', 'Predicate']
with open('example.txt') as f:
for line in f:
return;
正是在这一范围内未解决的参考。名称'get_func'在那里不存在。我会建议阅读基本的Python教程,因为这段代码展现了一些基本的错误,并且回答现在定义的这个问题是毫无意义的。 –