Install in seconds
Install this skill
Copy the command and run it in your terminal. You can review the source before installing.
terminal
git clone https://github.com/CoderWanFeng/python-office

Works with Git. The repository opens in your current directory.

🏷️
AutomationPython

Add Filename Prefix

by CoderWanFeng

Automates renaming files by adding a consistent prefix to each filename, useful for organizing batches of files quickly.

1.3K stars297 forksAdded 2026/07/20
officepippypipythonweixin

Documentation

README

file_name_add_prefix Skill

批量重命名:给文件名增加前缀

功能描述

给指定文件的文件名增加指定的前缀。

所属分类

office/skills/file/file_name_add_prefix/

调用方式

from office.skills.file import file_name_add_prefix

file_name_add_prefix(
    file_path='./test.txt',
    prefix_content='prefix_'
)

参数说明

参数 类型 必填 默认值 说明
file_path str - 文件路径
prefix_content str - 前缀内容

返回值

None

使用示例

from office.skills.file import file_name_add_prefix
file_name_add_prefix(file_path='./doc.txt', prefix_content='backup_')

原始函数

office.api.file.file_name_add_prefix