Skip to content

Instantly share code, notes, and snippets.

@dentropy
Created March 30, 2023 19:38
Show Gist options
  • Save dentropy/d9a761f05fe32ea9d4ccc0e9946a8f88 to your computer and use it in GitHub Desktop.
Save dentropy/d9a761f05fe32ea9d4ccc0e9946a8f88 to your computer and use it in GitHub Desktop.
num_lines = 3
import os
from glob import glob
files = glob("./dentropydaemon-wiki/**", recursive=True)
from pprint import pprint
for file_name in files:
if "md" in file_name and os.path.isfile(file_name):
file_contents = open(file_name, 'r').readlines()[3:]
new_file = open(file_name, 'w')
new_file.write("".join(file_contents))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment