我无法解决如何正确编写这个循环,它已经完成了 90%,但我无法解决这个问题:
string.replace(archive_header, "titlefixed", titlefixed)
必须包含在这个 for 循环中
for arfosers in archive_header, forum_header, search_header, rss_header:
arfosers.write(rss_header + string.replace(footer_p, "<!-- recent posts -->", postgroup))
arfosers.close()
(帮助我摆脱“rss header arfosers.write 行)
这些是我想在“for”循环中执行的行:
archive_header = string.replace(archive_header, "titlefixed", titlefixed)
archive_file.write(archive_header + archive_body + string.replace(footer_p, "<!-- recent posts -->", postgroup))
archive_file.close()
forum_header = string.replace(forum_header, "titlefixed", titlefixed)
forum_file.write(forum_header + string.replace(footer_p, "<!-- recent posts -->", postgroup))
forum_file.close()
search_header = string.replace(search_header, "titlefixed", titlefixed)
search_file.write(search_header + string.replace(footer_p, "<!-- recent posts -->", postgroup))
search_file.close()
rss_header = string.replace(rss_header, "titlefixed", titlefixed)
rss_file.write(rss_header + string.replace(footer_p, "<!-- recent posts -->", postgroup))
rss_file.close()