如何在Windows的回收站中删除文件? Python [英] How can I delete files from recycle bin in windows? python

查看:293
本文介绍了如何在Windows的回收站中删除文件? Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用python删除回收站中的文件,但是我找不到解决方法. 谢谢.

I'm trying to delete files that are in the recycle bin by using python, but i can't find a way to do it. Thanks.

推荐答案

对于Windows操作系统,您可以使用 winshell 模块,它是方法.

For the Windows OS you can use the winshell module and it's empty method.

清空回收站很简单:

import winshell
winshell.recycle_bin().empty(confirm=False, show_progress=False, sound=False)

在此处查看一些示例.

这篇关于如何在Windows的回收站中删除文件? Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆