python - 我的脚本运行良好,但由于我已经转移到另一台笔记本电脑
问题描述
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)
我不明白为什么会这样,我已经将它从一台笔记本电脑复制并粘贴到另一台笔记本电脑上,我错过了什么?
解决方案
推荐阅读
- php - 如何使用php从键值对中的多维数组中回显值
- spring - 如何使用 Spring Boot WebClient 收集分页 API 响应?
- javascript - 如何在jquery上动态添加数字顺序
- openshift - CLI 监控 OpenShift 中的连接池
- android - 如何用 FusedLocationProviderClient 替换 FusedLocationApi?
- html - 将 SVG 工具提示的悬停区域扩展到其父元素的边界之外
- javascript - 制作搜索功能
- javascript - 使用 reduce 重构函数 - javascript
- html - 如何垂直拉伸svg文本
- javascript - 如何让 mongoose 和 mongodb 正常工作?