「Python」send2trashでファイルを削除する

環境
PyCharm 2021.3
Python 3.9.7

構文
send2trash.send2trash(削除するファイルのパス)

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
import send2trash
print("send2trashでファイルを削除する結果")
send2trash.send2trash('C:\study\skill\python\\demo.csv')
import send2trash print("send2trashでファイルを削除する結果") send2trash.send2trash('C:\study\skill\python\\demo.csv')
import send2trash

print("send2trashでファイルを削除する結果")
send2trash.send2trash('C:\study\skill\python\\demo.csv')

実行結果
「C:\study\skill\python\\」のdemo.csvを削除しました。

Python

Posted by arkgame