github star gitee star atomgit star PyPI Downloads AI编程 AI交流群

大家好,我是正在实战各种 AI 项目的程序员晚枫。

经常有人问我:

"晚枫,你平时都用哪些 AI 工具?"
"有没有推荐的案例?"
"哪些案例最实用?"

今天我把每天在用的 10 个案例公开给你。

这些案例都来自 OpenClaw 案例库(https://www.python-office.com/openclaw/),每个都经过实战检验。

🏆 TOP 10 案例排名

No.10:PDF 转 Word 工具 ⭐⭐⭐⭐

使用频率:每周 3-5 次

场景

  • 合同需要编辑
  • 报告需要修改
  • 文档需要转换

代码

1
2
3
4
5
6
7
from pdf2docx import Converter

def pdf_to_word(pdf_path, word_path):
cv = Converter(pdf_path)
cv.convert(word_path)
cv.close()
print(f"转换完成:{word_path}")

节省时间:5 分钟/文件 → 30 秒

为什么用

  • 比在线工具快
  • 本地处理安全
  • 支持批量转换

No.9:图片批量重命名 ⭐⭐⭐⭐

使用频率:每周 2-3 次

场景

  • 产品图片整理
  • 截图归档
  • 照片分类

代码

1
2
3
4
5
6
7
8
9
import os
from datetime import datetime

def batch_rename(folder_path, prefix='img'):
for i, filename in enumerate(os.listdir(folder_path)):
old_path = os.path.join(folder_path, filename)
new_name = f"{prefix}_{datetime.now().strftime('%Y%m%d')}_{i:04d}.jpg"
new_path = os.path.join(folder_path, new_name)
os.rename(old_path, new_path)

节省时间:30 分钟 → 1 分钟

为什么用

  • 文件管理更规范
  • 查找更方便
  • 支持自定义规则

No.8:文件自动备份 ⭐⭐⭐⭐⭐

使用频率:每天自动运行

场景

  • 重要文档备份
  • 代码定期保存
  • 防止数据丢失

代码

1
2
3
4
5
6
7
8
9
import shutil
from datetime import datetime

def auto_backup(source_folder, backup_folder):
date_str = datetime.now().strftime('%Y%m%d_%H%M%S')
backup_name = f"backup_{date_str}"
backup_path = os.path.join(backup_folder, backup_name)
shutil.copytree(source_folder, backup_path)
print(f"备份完成:{backup_path}")

节省时间:手动备份 10 分钟 → 自动运行

为什么用

  • 数据安全有保障
  • 完全自动化
  • 支持增量备份

No.7:邮件群发助手 ⭐⭐⭐⭐

使用频率:每周 1-2 次

场景

  • 活动通知
  • 周报发送
  • 客户跟进

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import smtplib
from email.mime.text import MIMEText

def send_batch_emails(recipients, subject, content):
for email in recipients:
msg = MIMEText(content)
msg['Subject'] = subject
msg['From'] = 'me@company.com'
msg['To'] = email

server = smtplib.SMTP('smtp.company.com', 587)
server.login('user', 'password')
server.send_message(msg)
server.quit()

节省时间:30 分钟 → 2 分钟

为什么用

  • 支持个性化内容
  • 自动处理失败
  • 有发送记录

No.6:数据格式转换 ⭐⭐⭐⭐

使用频率:每周 3-4 次

场景

  • Excel 转 CSV
  • JSON 转 Excel
  • XML 转 JSON

代码

1
2
3
4
5
6
7
8
import pandas as pd
import json

def excel_to_json(excel_path, json_path):
df = pd.read_excel(excel_path)
data = df.to_dict(orient='records')
with open(json_path, 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=2)

节省时间:15 分钟 → 10 秒

为什么用

  • 支持多种格式
  • 转换准确
  • 可批量处理

No.5:网页截图工具 ⭐⭐⭐⭐

使用频率:每周 5+ 次

场景

  • 竞品页面保存
  • 数据快照
  • 证据留存

代码

1
2
3
4
5
6
7
from selenium import webdriver

def capture_webpage(url, output_path):
driver = webdriver.Chrome()
driver.get(url)
driver.save_screenshot(output_path)
driver.quit()

节省时间:手动截图 2 分钟 → 自动 10 秒

为什么用

  • 支持全网页截图
  • 可定时抓取
  • 批量处理

No.4:Excel 数据合并 ⭐⭐⭐⭐⭐

使用频率:每天 2-3 次

场景

  • 多表汇总
  • 数据整合
  • 报表生成

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pandas as pd
import glob

def merge_excel_files(pattern, output_path):
files = glob.glob(pattern)
all_data = []

for file in files:
df = pd.read_excel(file)
all_data.append(df)

merged = pd.concat(all_data, ignore_index=True)
merged.to_excel(output_path, index=False)
print(f"合并完成:{output_path}, 共{len(merged)}行")

节省时间:1 小时 → 30 秒

为什么用

  • 准确无误
  • 支持大文件
  • 可定制规则

No.3:定时任务管理 ⭐⭐⭐⭐⭐

使用频率:每天自动运行

场景

  • 定时报表
  • 定期备份
  • 自动同步

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import schedule
import time

def job():
print("执行定时任务...")
generate_report()
backup_data()

schedule.every().day.at("09:00").do(job)
schedule.every().friday.at("18:00").do(weekly_backup)

while True:
schedule.run_pending()
time.sleep(1)

节省时间:每天 30 分钟 → 完全自动

为什么用

  • 解放双手
  • 准时可靠
  • 支持复杂调度

No.2:智能文件分类 ⭐⭐⭐⭐⭐

使用频率:每天 5+ 次

场景

  • 下载文件夹整理
  • 文档自动归类
  • 桌面清理

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import shutil

def auto_sort_files(folder_path):
extensions = {
'图片': ['.jpg', '.png', '.gif'],
'文档': ['.doc', '.docx', '.pdf'],
'表格': ['.xls', '.xlsx', '.csv'],
'其他': []
}

for filename in os.listdir(folder_path):
file_path = os.path.join(folder_path, filename)
ext = os.path.splitext(filename)[1].lower()

for category, exts in extensions.items():
if ext in exts or not exts:
target_folder = os.path.join(folder_path, category)
os.makedirs(target_folder, exist_ok=True)
shutil.move(file_path, os.path.join(target_folder, filename))
break

节省时间:每天 15 分钟 → 自动完成

为什么用

  • 桌面永远整洁
  • 查找文件方便
  • 完全自动化

No.1:AI 自动回复 ⭐⭐⭐⭐⭐

使用频率:每天 50+ 次

场景

  • 微信消息回复
  • 邮件自动应答
  • 客服咨询

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from openclaw import Agent

agent = Agent(model='bailian/qwen3.5-plus')

def auto_reply(message):
# AI 理解意图
intent = agent.classify(message)

# 匹配回复策略
if intent == 'greeting':
return "您好!有什么可以帮您?"
elif intent == 'price':
return agent.chat(f"产品价格:{message}")
elif intent == 'support':
return "技术支持将在 24 小时内回复您。"
else:
return agent.chat(message)

节省时间:每天 2 小时 → 10 分钟

为什么用

  • 回复准确
  • 7x24 小时在线
  • 越用越聪明

📊 使用统计

时间节省

案例原耗时现耗时节省
AI 自动回复2 小时/天10 分钟92%
智能文件分类15 分钟/天自动100%
定时任务30 分钟/天自动100%
Excel 合并1 小时/天30 秒99%
网页截图10 分钟/天1 分钟90%

总计节省:约 3.5 小时/天

使用频率

频率案例数案例
每天5 个AI 回复、文件分类、定时任务、Excel 合并、备份
每周 3-5 次3 个PDF 转换、数据转换、网页截图
每周 1-2 次2 个邮件群发、图片重命名

💡 使用心得

心得 1:自动化是王道

能用自动的,绝不手动。

一旦某个操作重复 3 次以上,我就写脚本自动化。

回报

  • 初期投入:30 分钟写脚本
  • 长期回报:每天节省时间
  • ROI:超高

心得 2:组合使用威力大

单个案例解决单点问题,组合使用解决复杂问题。

我的组合

1
文件下载 → 智能分类 → 定时备份 → 通知发送

心得 3:持续优化

脚本不是一劳永逸,需要持续优化。

我的做法

  • 记录使用情况
  • 收集问题反馈
  • 定期更新改进

📚 相关资源

案例库地址

https://www.python-office.com/openclaw/

课程推荐


🎯 AI 编程课程海报

想系统学习 OpenClaw 和 AI 编程?

联系方式

主营业务:AI 编程培训、企业内训、技术咨询


本文是"OpenClaw 中文案例库"系列第 16 篇,侧重个人工具箱。

更新时间:2026-03-16 18:29

🎓 AI 编程实战课程

想系统学习 AI 编程?程序员晚枫的 AI 编程实战课 帮你从零上手!