PYTHON 3.4 我想保存到第21行,但它保存到第1行,当我保存到第22行时
if event == 'Event 1' and indivcombo == 'Individual 1':
with open("data/tournamentdatae1.txt",'r+') as f:
for i,line in enumerate(get_all,1):
if i == 21:
individualmain = individual.get()
f.writelines(individualmain)
f.writelines("\n")
答案 0 :(得分:0)
确保在计算import django.core.paginator
def _new_get_page(self, *args, **kwargs):
return SpecialPage(*args, **kwargs)
django.core.paginator._get_page = _new_get_page
后关闭并重新打开文件,并且您有Page
来写剩余的行
Page