Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

List

未关闭
#197 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清
技术栈
python
领域
tooling

调研方向

未识别出任何仓库文件、测试或所请求的更改;首先明确“List”应向 PatternLanguage 添加什么,并定位任何相关的入口点。在明确预期行为和验收标准之前,无法定义 Done。

由索引模型根据 Issue 内容生成。

描述

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.")
主要语言
C++
星标
278
派生
77
平均合并
2 天 8 小时
30 天内合并 PR
7

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

WerWolv/PatternLanguage 的其他 Issue

查看 WerWolv/PatternLanguage 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。