import itchat
def we_chat(message):
#enableCmdQR=2用于linux中显示二维码,hotReload=True退出程序后暂存登录状态
itchat.auto_login(hotReload=True,enableCmdQR=2)
boom_remark_name = input('好友备注名称:')
# message = input('输入你要轰炸的内容,按回车键开始轰炸')
boom_obj = itchat.search_friends(remarkName=boom_remark_name)[0]['UserName']
itchat.send_msg(msg=message, toUserName=boom_obj)
print('发送成功!')
we_chat('你好)
来源:oschina
链接:https://my.oschina.net/u/4293290/blog/3424111