Skip to content

Commit

Permalink
added empty solution.md finder python program
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnLu2004 committed Jul 18, 2024
1 parent 6e8346c commit bc3fc3d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/content/questions/comp2804/empty_solution_file_finder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os

def find_empty_solution_files(directory):
for root, _, files in os.walk(directory):
for file in files:
if file == 'solution.md':
file_path = os.path.join(root, file)
relative_path = os.path.relpath(file_path, directory)
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read().strip()
if not content:
print(f"Empty file: {relative_path}")

if __name__ == "__main__":
directory = os.path.dirname(os.path.abspath(__file__))
find_empty_solution_files(directory)

0 comments on commit bc3fc3d

Please sign in to comment.