Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I delete files from recycle bin in windows? 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.

like image 322
Shir K. Avatar asked Dec 10 '22 13:12

Shir K.


1 Answers

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

Emptying the recycle bin is as easy as:

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

See some examples here.

like image 101
gus27 Avatar answered Dec 13 '22 22:12

gus27