FMHYedit/.github/single-page.py

28 lines
661 B
Python
Raw Normal View History

2023-04-09 16:30:28 +00:00
import glob
import time
def output():
read = glob.glob("*.md")
content = ""
nsfw_content = ""
2023-04-09 16:30:28 +00:00
for file in read:
if file != "README.md":
2023-04-09 16:30:28 +00:00
with open(file, "r") as f:
if "nsfw" in file.lower():
nsfw_content += f.read()
continue
2023-04-09 16:30:28 +00:00
content += f.read()
return content + nsfw_content
2023-04-09 16:30:28 +00:00
def main():
content = output()
with open("single-page", "w") as file:
file.write(content)
if __name__ == "__main__":
s = time.perf_counter()
main()
elapsed = time.perf_counter() - s
print(f"{__file__} executed in {elapsed:0.2f} seconds.")