发送2trash模块值

2024-06-28 15:25:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用python中的send2trash模块来执行“自动化无聊的事情”,但我始终收到以下错误:

Python 3.5.4 (v3.5.4:3f56838, Aug  8 2017, 02:17:05) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import send2trash
>>> send2trash.send2trash(r"C:\Users\Ian\Desktop\tMorph\tMorph.dll")
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    send2trash.send2trash(r"C:\Users\myusernamehere\Desktop\tMorph\tMorph.dll")
  File "C:\Users\myusernamehere\AppData\Local\Programs\Python\Python35\lib\site-
packages\send2trash\plat_win.py", line 49, in send2trash
    fileop.pFrom = LPCWSTR(path + '\0')
ValueError: embedded null character

我在不同的位置尝试了多个文件,但仍然得到完全相同的错误。在

谢谢!在


Tags: 模块in错误linebit事情usersaug