首页 > 解决方案 > 我的脚本运行良好,但由于我已经转移到另一台笔记本电脑

问题描述

from slackclient import SlackClient
#imports slack library

slack_client = SlackClient(“token is here hidden in this post”)
#API ACCESS

if __name__ == ’__main__‘:
api_call = slack_client.api_call(“users.list”)
#Pull’s a list of users from slack
if api_call.get(‘ok’):
    users = api_call.get(‘members’)
    for user in users:
        print(user[‘name’] + ' : ' + user.get(‘id’))
        #displays user names with according ID’s


member = raw_input (“Please type the ID of the member you would like to disable: “)

for user in users:
    if user.get(‘id’) == member:
        # disable account
        slack_client.api_call(
        ‘users.admin.setInactive’,
        user=member
        )
        print “User Disabled”

我的代码现在出现错误:

                               ^
SyntaxError: invalid character in identifier (line 5)

我不明白为什么会这样,我已经将它从一台笔记本电脑复制并粘贴到另一台笔记本电脑上,我错过了什么?

标签: pythonslack

解决方案



推荐阅读