我正在尝试使用 python 删除回收站中的文件,但我找不到方法。
谢谢。
对于 Windows 操作系统,您可以使用winshell https://github.com/tjguk/winshell模块和它的empty https://winshell.readthedocs.io/en/latest/recycle-bin.html#winshell.ShellRecycleBin.empty method.
清空回收站非常简单:
import winshell
winshell.recycle_bin().empty(confirm=False, show_progress=False, sound=False)
看一些例子在这里 http://programtalk.com/python-examples/winshell.recycle_bin/.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)