import send2trash #pip install send2trash on the command line send2trash.send2trash("/location/to/file")