且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用PyQt4将文件移到不同平台上的回收站/回收站中?

更新时间: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")