WerWolv / WerWolv/PatternLanguage
List
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 275
- Forks
- 75
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 10
Description
import os
def find_files_by_keyword(root_directory, keyword):
"""
Searches for files containing a specific keyword in their name within a directory
and all its subdirectories.
Args:
root_directory (str): The absolute path to the folder to start searching from.
keyword (str): The word to search for in the filenames.
"""
found_files = []
print(f"Searching for files with '{keyword}' in the name, starting from '{root_directory}'...\n")
# os.walk() is a powerful generator that "walks" a directory tree
for dirpath, dirnames, filenames in os.walk(root_directory):
for filename in filenames:
# Check if the keyword (case-insensitive) is in the filename
if keyword.lower() in filename.lower():
full_path = os.path.join(dirpath, filename)
found_files.append(full_path)
return found_files
--- HOW TO USE THIS SCRIPT ---
if name == "main":
# 1. SET THE FOLDER YOU WANT TO SEARCH
# Example for Windows: 'C:\Users\YourUsername\Documents'
# Example for macOS/Linux: '/Users/YourUsername/Documents'
# IMPORTANT: Use an absolute path for best results.
search_path = "C:\Users\YourUsername\Documents"
# 2. SET THE KEYWORD YOU ARE LOOKING FOR
keyword_to_find = "report"
# Run the search function
results = find_files_by_keyword(search_path, keyword_to_find)
# 3. PRINT THE RESULTS
if results:
print("--- Found Files ---")
for file_path in results:
print(file_path)
else:
print(f"No files found with the keyword '{keyword_to_find}' in that location.")
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file, test, or requested change is identified; start by clarifying what “List” should add to PatternLanguage and locating any relevant entry point. Done cannot be defined until the expected behavior and acceptance criteria are specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100