Python deletes files to recycle bin

xiaoxiao2021-03-06  14

With the shell module inside Active Python, you can complete the operation of deleting to the recycle bin, as follows: From Win32com.Shell Import Shell, Shellcon Def DeltoreClebin (filename): shell.shfileOperation ((0, shellcon.fo_delete, filename, none, / shellcon). FOF_SILENT | / SHELLCON.FOF_ALLOWUNDO | / shellcon.fof_noconfirmation, none, none) FILENAME mainly uses the full path, and the specific usage of SHFileOperation can see MSDN.

转载请注明原文地址:https://www.9cbs.com/read-49830.html

New Post(0)