๐ File Module Guide
This page is currently only available in Chinese. Please switch to ็ฎไฝไธญๆ for the full content.
๐ File Module Guide
The File module focuses on batch file management, especially rename and search.
Core Scenariosโ
Batch Rename (Replace)โ
import office
office.file.replace4filename(
path='./photos/',
del_content='IMG_',
replace_content='travel_'
)
Add Prefix / Suffixโ
office.file.file_name_add_prefix(file_path='./docs/', prefix_content='2026_')
office.file.file_name_add_postfix(file_path='./docs/', postfix_content='_v1')
Export File Names to Excelโ
office.file.output_file_list_to_excel(dir_path='./docs/')
Search Files by Typeโ
files = office.file.get_files(path='./', suffix='.xlsx', sub=True)
print(f"Found {len(files)} Excel files")
Full API see File API Reference
AI ๅๅ
ฌๆ็่ฏพ
35 ่ฎฒ AI ่ชๅจๅๅๅ
ฌๅฎๆ่ฏพ็จ Python + AI ๅค็ ExcelใWordใPDFใ้ฎไปถ็ญๅๅ
ฌๅบๆฏใ
ๅปๅญฆไน