嗨,我正试图在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