| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1514 人关注过本帖
标题:新手调试程序总出现莫名奇妙的错误,求大家指点
只看楼主 加入收藏
枕上卢生
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2020-2-5
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
新手调试程序总出现莫名奇妙的错误,求大家指点
大家好,我是一个python新手,刚入门,想写一个获取微信群成员头像的代码,课是调试时总出弦如下错误,还求大家指点。谢谢大家。
错误:

Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Thread-17Exception in thread Exception in thread Exception in thread Exception in thread Thread-18Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Thread-19Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Thread-20Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread Exception in thread

我的代码:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from wxpy import *
import threading
import os
import time

class wechatInfo (object):
    # 初始化微信
    def __init__ (self):
        self.bot = Bot()
        self.myself = self.bot.self
        self.friends = self.bot.friends()
        # self.tuling = Tuling(api_key='ad68c7fe6caf4d29bb78fe36cbbf1b63')

    def main (self):
        if not os.path.exists('./info/' + wechat.myself.name):
            filepath = os.getcwd()
            os.makedirs(filepath + '/info/' + wechat.myself.name + '/headImg')
            self.getGroupsList()

    # 获取群列表
    def getGroupsList (self):
        groups = self.bot.groups()
        print(groups)
        for i in range(len(groups)):
            group = groups[i]
            for f in range(len(group.members)):
                if f == 0:
                    writeType = 'w'
                else:
                    writeType = 'a'

                t = threading.Thread(target=self.saveHeadImg, args=(group.members[f],))
                t.start()

    # 保存头像
    def saveHeadImg (groups, member):
        print('正在保存 %s 的头像...' % member.name)
        groups.get_avatar('info/%s/headImg/%s_%s.jpg' % (self.myself.name, member.name[:20], time.time()))


    # def reply_msg(self, msg):
    #     self.tuling(msg)

if __name__ == "__main__":
    wechat = wechatInfo()
    wechat.main()

搜索更多相关主题的帖子: name thread Exception def 错误 
2020-02-05 03:07
wp231957
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:神界
等 级:贵宾
威 望:423
帖 子:13688
专家分:53332
注 册:2012-10-18
收藏
得分:20 
微信网页端口被腾讯关闭了,玩不了了

DO IT YOURSELF !
2020-02-06 08:42
快速回复:新手调试程序总出现莫名奇妙的错误,求大家指点
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023478 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved