Python Library: Send2Trash

small package that sends files to the Trash (or Recycle Bin) natively and on all platforms

12 Sep 2022

Library resources
PyPI https://pypi.org/project/Send2Trash/
Github https://github.com/arsenetar/send2trash
Documentation ---

Better (safer) approach than os.remove()....

Install

pip3 install Send2Trash

or

python3 -m pip install -U send2trash

To install with pywin32 or pyobjc required specify the extra nativeLib:

python3 -m pip install -U send2trash[nativeLib]

Usage

from send2trash import send2trash
send2trash('some_file')
send2trash(['some_file1', 'some_file2'])

links

social