我想知道如何在 Python 中允许多个输入。
例如:如果消息是“!comment postid customcomment”
,我希望能够获取该帖子 ID,将其放在某个地方,然后是 customcomment,然后将其放在其他地方。
这是我的代码:
import fb
token="access_token_here"
facebook=fb.graph.api(token)
#__________ Later on in the code: __________
elif msg.startswith('!comment '):
postid = msg.replace('!comment ','',1)
send('Commenting...')
facebook.publish(cat="comments", id=postid, message="customcomment")
send('Commented!')
我似乎无法弄清楚。
提前谢谢你。