How can I move file into Recycle Bin / trash on different platforms using PyQt4?

前端 未结 3 1381
渐次进展
渐次进展 2021-02-01 02:36

I would like to add the next feature to my cross-platform PyQt4 application: when user selects some file and select \"remove\" action on it that file will be moved to Recycle Bi

3条回答
  •  礼貌的吻别
    2021-02-01 03:02

    It's a good thing you're using Python, I created a library to do just that a while ago:

    http://www.hardcoded.net/articles/send-files-to-trash-on-all-platforms.htm

    On PyPI: Send2Trash

    Installation

    Using conda:

    conda install Send2Trash
    

    Using pip:

    pip install Send2Trash
    

    Usage

    Delete file or folders

    from send2trash import send2trash
    send2trash("directory")
    

提交回复
热议问题