From c52cc47e4adbf3440142f34cdb742a5e18202013 Mon Sep 17 00:00:00 2001 From: maxiwee69 Date: Thu, 25 Jan 2024 13:12:41 +0100 Subject: [PATCH] oki --- footer.py | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 footer.py diff --git a/footer.py b/footer.py deleted file mode 100644 index e289a97..0000000 --- a/footer.py +++ /dev/null @@ -1,32 +0,0 @@ -import os -import re - -# Specify the directory you want to start from -root_dir = r'C:\Users\maxi\maxiwee69.github.io' - -# Walk through all subdirectories -for dirpath, dirnames, filenames in os.walk(root_dir): - for filename in filenames: - filepath = os.path.join(dirpath, filename) - if filename.endswith('.html'): - with open(filepath, 'r+') as file: - # Read the existing content - content = file.read() - # Remove the footer - content = re.sub(r'', '', content, flags=re.DOTALL) - # Write the new content back to the file - file.seek(0) - file.write(content) - file.truncate() - print(f'Removed footer from: {filepath}') - elif filename.endswith('.css'): - with open(filepath, 'r+') as file: - # Read the existing content - content = file.read() - # Remove the footer CSS rules - content = re.sub(r'footer\s*{[^}]*}', '', content) - # Write the new content back to the file - file.seek(0) - file.write(content) - file.truncate() - print(f'Removed footer CSS from: {filepath}')