语法错误:(unicode 错误)"unicodeescape"编解码器无法解码位置 194-195 中的字节:截断的 \UXXXXXXXX 转义



嗨,我正试图在python中运行一个非常复杂的cmd命令,但标题中不断出现错误!这是命令:

os.system('cmd /c dotnet DicordChatExporter.CLIDiscordChatExporter.CLi.dll export -t "[insert discord token here]" -c 939905115505180682 -o C:UsersDannyDiscordExportslog.txt -f PlainText')

python字符串中有特殊含义,因此您需要通过加倍来转义它以获得文本,所有路径中的所有都应该使用\来替换,例如

C:UsersDannyDiscordExportslog.txt

应该是

C:\Users\Danny\DiscordExports\log.txt

最新更新