Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 python 创建一个电报机器人,但我找不到使用 bot.sendMessage 输出变量的方法。任何人都可以帮助我吗?
var = '123' bot.sendMessage(chat_id, "The number is:"var)
这是一个 python 语法错误。你没有连接。例如,您可以这样做(但您也可以使用其他方式连接):
var = '123' bot.sendMessage(chat_id, "The number is:{}".format(var))