Skip to content

Commit

Permalink
Update consolidated snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 31, 2024
1 parent f8ff933 commit 159f0de
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions public/consolidated/all_snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1299,17 +1299,13 @@
"import os",
"",
"def find_files(directory, file_type):",
" file_type = file_type.lower() # Convert file_type to lowercase",
" found_files = []",
" file_type = file_type.lower()",
" found_files = []",
"",
" for root, _, files in os.walk(directory):",
" for file in files:",
" file_ext = os.path.splitext(file)[1].lower()",
" if file_ext == file_type:",
" full_path = os.path.join(root, file)",
" found_files.append(full_path)",
"",
" return found_files",
" for entry in os.scandir(directory):",
" if entry.is_file() and entry.name.lower().endswith(file_type):",
" found_files.append(entry.name)",
" return found_files",
"",
"# Example Usage:",
"pdf_files = find_files('/path/to/your/directory', '.pdf')",
Expand Down

0 comments on commit 159f0de

Please sign in to comment.