这应该采取一行,并显示在一个文本框,这应该工作,但一定有一个错误,我看不出来。你知道吗
def show_indiv():
with open("data/tournamentdatae1.txt",'r') as f:
event = combo_event.get()
indivcombo = combo_individual.get()
if event == 'Event 1' and indivcombo == 'Individual 1':
with open('data/tournamentdatae1.txt', 'r') as f:
for i,line in enumerate(f,1):
if i == 21:
indiv_txt.insert(0.0, line)
不必要地嵌套循环,并打开同一个文件三次。但真正的问题是插入了
get_all
;行列表,而不是行。我的建议是:相关问题 更多 >
编程相关推荐