繁体   English   中英

Python elif 语法错误

[英]Python elif syntax error

获取错误:

ev3rest@EV3RESTs-MBP ~/Desktop> python telegram.py
  File "telegram.py", line 55
    elif message == '/start':
       ^
SyntaxError: invalid syntax

代码:

if message == '/help':
send_respond ('/help respond message', from_id)
elif message == '/start':
    send_respond ('/help - Show available commands list', from_id)
elif message == 'Привет':
    send_respond ('Приветики!', from_id)

不知道如何修复它,我检查了标签,但这不起作用:/

向后缩进这一步:

if message == '/help':
    send_respond ('/help respond message', from_id)  #<------------------HERE

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM