CAN矩阵-TypeError:None类型对象不可迭代

时间:2019-06-24 13:15:55

标签: python tkinter exe can-bus

当文件转换为在Anaconda导航器中执行的exe时,获取TypeError。不确定软件包的依赖性或exe转换问题。

代码错误1

Exception in Tkinter callback
Traceback (most recent call last):
  File "tkinter\__init__.py", line 1699, in __call__
  File "Smart_Fn.py", line 244, in openFile
    convert(infile, outfile)
  File "Smart_Fn.py", line 80, in convert
    for name in dbs:
TypeError: 'NoneType' object is not iterable 

代码段2

 def convert(infile, out_file_name, **options):
        logger.info("Importing " + infile + " ... ")
        dbs = canmatrix.formats.loadp(infile, **options)
        logger.info("done\n")

        logger.info("Exporting " + out_file_name + " ... ")

        out_dbs = {}
        for name in dbs:
            db = None

            if 'ecus' in options and options['ecus'] is not None:
                ecu_list = options['ecus'].split(',')
                db = cm.CanMatrix()
                for ecu in ecu_list:
                    canmatrix.copy.copy_ecu_with_frames(ecu, dbs[name], db)
            if 'frames' in options and options['frames'] is not None:
                frame_list = options['frames'].split(',')
                db = cm.CanMatrix()

0 个答案:

没有答案