相关疑难解决方法(0)

TypeError:'NoneType'对象在Python中不可迭代

错误TypeError: 'NoneType' object is not iterable是什么意思?

我在这个Python代码上得到它:

def write_file(data, filename): # creates file and writes list to it
  with open(filename, 'wb') as outfile:
    writer = csv.writer(outfile)
    for row in data: # ABOVE ERROR IS THROWN HERE
      writer.writerow(row)
Run Code Online (Sandbox Code Playgroud)

python nonetype

127
推荐指数
6
解决办法
50万
查看次数

标签 统计

nonetype ×1

python ×1