【问题标题】:unexpected character after line continuation character in pythonpython中的行继续字符后的意外字符
【发布时间】:2020-01-18 10:47:10
【问题描述】:

它说这个错误:

    r = requests.post(webhookLink, data={"embeds":[{"title":\"webhookEmbedTitle\","description":\"webhookEmbedDescription\","color":webhookEmbedColor,"thumbnail":{"url":\"webhookEmbedThumbnail\"}}]})
                                                                                                                                                                                                      ^
SyntaxError: unexpected character after line continuation character

有人可以帮忙吗?我是 python 新手...

【问题讨论】:

  • 如果您是 Python 新手,请练习研究错误消息。谷歌错误是什么,看看它说了什么。
  • 看起来您正在尝试使用引号转义 \" 但不在字符串内,因此没有任何意义。

标签: python json python-3.x webhooks


【解决方案1】:

由于您提供的信息量有限,这是您能得到的最佳答案。

看起来你从互联网或一本书中复制了该功能......并且它们在单独的行中完成,例如:

r = requests.post(webhookLink, data={"embeds":[{"title":\
"webhookEmbedTitle\","description":\
"webhookEmbedDescription\","color":webhookEmbedColor,"thumbnail":{"url":\
"webhookEmbedThumbnail\"}}]})

你有两个选择,要么像这样放在单独的行中,要么删除这个字符\

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多