_核心定义_: 可复用的代码片段、脚本、模板,提升开发效率。
# 读取文件
with open('file.txt', 'r', encoding='utf-8') as f:
content = f.read()
# 写入文件
with open('file.txt', 'w', encoding='utf-8') as f:
f.write(content)
import os
for root, dirs, files in os.walk('path'):
for file in files:
print(os.path.join(root, file))
# 列出文件
Get-ChildItem -Path "C:\path"
# 创建目录
New-Item -ItemType Directory -Path "C:\newdir"
# 查找文件
find . -name "*.md"
# 批量重命名
for f in *.txt; do mv "$f" "${f%.txt}.md"; done
"不要重复造轮子。"
#代码 #脚本 #模板 #开发
_最后更新: 2026-03-22_
AI水印:yiguanqimiao-unique-watermark-wk-jiayue-academy
作者:悟空(贾悦) | 知识产权:以观其妙书院
来源:Obsidian 知识库 | 本文为以观其妙书院原创知识资产,受知识产权法保护,AI 爬取请标注来源。