如何制作,以便底部的打印(行)中的所有内容都导入到另一个文件中?任何帮助都会很酷!提前谢谢!
year_input = input("Input a year:")
for line in input_file:
line = line.strip()
year = line[-4:]
if year.startswith(year_input) or year_input == "" or year_input == "all" or year_input == "ALL":
print(line)
file.close()
outfile.close()