类型错误:'长' 对象不可迭代

2024-06-16 11:36:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我刚刚用python创建了一个字典。

stb_info = self.stb_type()
print type(stb_info) #The output gives me dict

当我想为每组运行tread函数时

for group_no, shelves in stb_info:
    self.thread_function(group_no, shelves)

我得到以下错误:

TypeError: 'long' object is not iterable

那么,我怎样才能解决这个问题呢?


Tags: thenoselfinfooutput字典typegroup