更新时间:2023-02-14 13:58:02
使用Python是一件好事,我不久前创建了一个库来做:
It's a good thing you're using Python, I created a library to do just that a while ago:
http://www.hardcoded. net/articles/send-files-to-rash-on-all-platforms.htm
在PyPI上: Send2Trash
安装
使用conda:
conda install Send2Trash
使用点子:
pip install Send2Trash
用法
删除文件或文件夹
from send2trash import send2trash
send2trash("directory")