import itchat,time
from itchat.content import * itchat.auto_login(enableCmdQR=-1)
while True:
for i in range(1,10):
if i == 3:
friend_cijingchangcun = itchat.search_friends("此景长存") #获取个人字典信息
jiangxinlong=friend_cijingchangcun[0]["UserName"] #筛选个人信息
friend_danding = itchat.search_friends("淡定")
wangdong = friend_danding[0]["UserName"]
print(jiangxinlong)
friend_list=[wangdong,jiangxinlong]
content=i #发送的消息
for i in friend_list:
itchat.send_msg(msg=content,toUserName=i) #发送信息给微信好友
time.sleep(5)
elif i == 7:
friend_cijingchangcun = itchat.search_friends("此景长存") # 获取个人字典信息
jiangxinlong = friend_cijingchangcun[0]["UserName"] # 筛选个人信息
friend_danding = itchat.search_friends("淡定")
wangdong = friend_danding[0]["UserName"]
print(jiangxinlong)
friend_list = [wangdong, jiangxinlong]
content = i # 发送的消息
for i in friend_list:
itchat.send_msg(msg=content, toUserName=i) # 发送信息给微信好友
time.sleep(5)
else:
time.sleep(5)

微信调用itchat库 实现发消息的更多相关文章

  1. 全网最全的Windows下Python2 / Python3里正确下载安装用来向微信好友发送消息的itchat库(图文详解)

    不多说,直接上干货! 建议,你用Anaconda2或Anaconda3. 见 全网最全的Windows下Anaconda2 / Anaconda3里正确下载安装用来向微信好友发送消息的itchat库( ...

  2. 通过程序调用微信公众号发消息api返回48001

    自己的订阅号,尝试通过写程序来给用户发消息.结果呢,接口返回报错:errcode=48001,errmsg = api unauthorized hint: [ZlPULa02942276!] 去微信 ...

  3. python使用itchat库实现微信机器人

    itchat是一个开源的微信个人号接口,可以使用该库进行微信网页版中的所有操作,比如:所有好友.添加好友.拉好友群聊.微信机器人等等.详细用户请看文档介绍,在这里. 本文主要使用该库完成一个能够处理微 ...

  4. itchat库微信自动回复祝福语

    过年了,之前看到一些python文章介绍用itchat自动回复微信,我自己就写了一个. 官方文档https://itchat.readthedocs.io/zh/latest/,这个库挺简洁的,对着接 ...

  5. iPad版微信终于来临了 微信5.4版搜索更智能 转账就是发消息

    等待甚久的iPad版微信终于来临了!昨日微信iOS版本更新至5.4.0.16,新增功能包括搜索公众号.识别图中二维码.面对面收钱,同时适配iPad.(微信5.4安卓版重回ios风格 导航菜单都放底栏位 ...

  6. python实现微信接口(itchat)

    python实现微信接口(itchat) 安装 sudo pip install itchat 登录 itchat.auto_login() 这种方法将会通过微信扫描二维码登录,但是这种登录的方式确实 ...

  7. python实现微信接口——itchat模块

    python实现微信接口——itchat模块 安装 sudo pip install itchat 登录 itchat.auto_login()  这种方法将会通过微信扫描二维码登录,但是这种登录的方 ...

  8. Qt中调用PolarSSL库(一)

    最近一直在学习SSL相关的知识,也是先了解理论相关的知识,主要是SSL相关的基本概念和连接建立过程,主要是基于PolarSSL开源库进行学习.学习完了之后就希望能给有所运用,就想用Qt写一个简单的程序 ...

  9. 微信公众平台开发,模板消息,网页授权,微信JS-SDK,二维码生成(4)

    微信公众平台开发,模板消息,什么是模板消息,模板消息接口指的是向用户发送重要的服务通知,只能用于符合场景的要求中去,如信用卡刷卡通知,购物成功通知等等.不支持广告营销,打扰用户的消息,模板消息类有固定 ...

随机推荐

  1. SQL Server--------SQL Server问题错误解决

    1.错误提示: 修改字段属性时,提示: 消息 5074,级别 16,状态 1,第 1 行对象'DF__dms_deliv__sync___51BAE991' 依赖于 列'sync_ff_result_ ...

  2. 2017-2018 ACM-ICPC NEERC B题Berland Army 拓扑排序+非常伤脑筋的要求

    题目链接:http://codeforces.com/contest/883/problem/B There are n military men in the Berland army. Some ...

  3. 类Shiro权限校验框架的设计和实现(2)--对复杂权限表达式的支持

    前言: 我看了下shiro好像默认不支持复杂表达式的权限校验, 它需要开发者自己去做些功能扩展的工作. 针对这个问题, 同时也会为了弥补上一篇文章提到的支持复杂表示需求, 特地尝试写一下解决方法. 本 ...

  4. annotation的概念及其作用

    概念 能够添加到 Java 源代码的语法元数据.类.方法.变量.参数.包都可以被注解,可用来将信息元数据与程序元素进行关联.Annotation 中文常译为“注解”. 作用 标记,用于告诉编译器一些信 ...

  5. Centos7 安装Nginx 防火墙开放80端口给外网访问

    Centos7的防火墙改成了firewall,不再叫iptables,开放端口的方法如下: firewall-cmd --zone=public --add-port=80/tcp --permane ...

  6. PythonStudy——Pycharm 小技巧

    分享Pycharm中一些不为人知的技巧 工欲善其事必先利其器,Pycharm 是最受欢迎的Python开发工具,它提供的功能非常强大,是构建大型项目的理想工具之一,如果能挖掘出里面实用技巧,能带来事半 ...

  7. PythonStudy——列表的常用操作 List of common operations

    # 1.索引取值: 列表名[index] s1 = [1, 3, 2] print(s1[0]) print(s1[-1]) # 2.列表运算: 得到的是新list s2 = [1, 2, 3] pr ...

  8. 2.3 Visio画虚线后插入word或PPT变为实线

    选中实线后,左键选择->格式->线条->粗细->自定义->设置为0pt

  9. [转]马上2018年了,该不该下定决心转型AI呢

    转自:http://blog.csdn.net/eNohtZvQiJxo00aTz3y8/article/details/78941013 2017年,AI再一次迈向风口,但我们如何判断未来走向?应不 ...

  10. 用git,clone依赖的库

    git clone https://github.com/influxdata/influxdb-java.git cd crfasrnn git submodule update --init -- ...