first pip3 install itchat

The code is as follows

#!/usr/bin/python2.7 # -*- coding: utf-8 -*- import itchat import json import
randomimport sys reload(sys) sys.setdefaultencoding('utf8') # Get processing groups def
create_process_list(process_size): process_list = [] default_process_size = 35
process_group_size = process_size / default_process_sizeif process_size %
default_process_size >0: process_group_size = process_group_size + 1 for i in
range(process_group_size): start = (i * default_process_size) end = start +
default_process_sizeif end > process_size: end = process_size
process_list.append({'start': start, 'end': end}) return process_list def
get_delete_user_list(start, end, friends): print 'start run get_delete_user
start: '+ str(start) + ', end: ' + str(end) process_member_list =
friends[start:end] member_dict = {}for member in process_member_list:
member_dict[member['UserName']] = member print member['NickName'] + '-----' +
str(start) group_name = 'g1' + str(random.randint(0,1199)) print 'group_name:'
+ group_name result = itchat.create_chatroom(process_member_list, group_name)
print'result: ' + json.dumps(result) result_member_list = result['MemberList']
delete_list = []for result_member in result_member_list: print
'---------------member-------------' print json.dumps(result_member) if
result_member['MemberStatus'] == 4: # Deleted by the other party delete_list.append(result_member[
'UserName']) print ' This man deleted me ' + result_member['UserName'] return delete_list
itchat.auto_login(hotReload=True) friends = itchat.get_friends() friends_len =
len(friends) print ' Print friends :' + str(friends_len) process_list =
create_process_list(friends_len) delete_user_list = []for process in
process_list: start = process['start'] end = process['end'] list =
get_delete_user_list(start, end, friends) print ' Delete my people :' + str(len(list)) #
list = get_delete_user_list(170, 173, friends)# print ' Delete my people :' + str(len(list))
# print ' Delete my people :' + str(len(delete_user_list))# for itchat.dump_login_status()

Technology
©2019-2020 Toolsou All rights reserved,
First knowledge python Skills summary GDOI2019 travels c Linguistic 5 Three common sorting methods Python Basic knowledge and notes " Cephalosporin wine Say go and go "? DANGER ! Don't drink alcohol when taking these drugs Thorough explanation from Zhongtai vue The component page height is adaptive according to the screen size Classical algorithm - recursion ( The case of raw rabbit ) Big data tells you , How tired are Chinese women about keras use fit_generator Encountered in StopIteration