0
点赞
收藏
分享

微信扫一扫

python中wechat控制电脑

互联网码农 2022-11-20 阅读 106


import itchat
import time
import random
import os

@itchat.msg_register(itchat.content.TEXT)
def text_reply(s):
if s['ToUserName']=='filehelper':
command=s['Content']
print(command)

if os.system(command)==0:
res=os.popen(command).read()
result='执行成功,结果\n'+res
itchat.send(result,'filehelper')
else:
result='失败,重式%s'%command
itchat.send(result,'filehelper')
itchat.auto_login()
itchat.run()

举报

相关推荐

0 条评论