我的脚本运行良好,但是由于我已经转移到另一台笔记本电脑

时间:2018-07-19 13:45:32

标签: python slack

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)

我不明白为什么这样做,我已经将其从一台笔记本电脑复制并粘贴到另一台笔记本电脑上,我想念什么?

2 个答案:

答案 0 :(得分:1)

引号package javaPrograms; import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.regex.*; public class SolutionRansom { static void checkMagazine(String[] magazine, String[] note) { int i,j; for(i=0;i<note.length;i++){ for(j=0;j<magazine.length;j++){ if(magazine[j]==note[i]){ System.out.println(note[i]); } } } } public static void main(String[] args) { Scanner sc=new Scanner(System.in); int ml=sc.nextInt(); int nl=sc.nextInt(); String m[]=new String[ml]; String n[]=new String[nl]; for(int a=0;a<ml;a++) { m[a]=sc.next(); } for(int b=0;b<nl;b++) { n[b]=sc.next(); } checkMagazine(m,n); } } 是无效的Python。改用'

答案 1 :(得分:0)

遍历代码,并手动替换所有单引号和双引号的实例;复制/粘贴时有些东西弄乱了。