TypeError:“file”类型的参数不是iterable 2.7 python

2024-09-27 17:38:51 发布

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

我正在尝试创建一个现有的字典并将其写入csv文件,但我一直遇到这个错误,我无法确定:

Traceback (most recent call last):
  File "/Users/Danny/Desktop/Inventaris.py", line 52, in <module>
    Toevoeging_methode_plus(toevoegproduct, aantaltoevoeging)
  File "/Users/Danny/Desktop/Inventaris.py", line 9, in Toevoeging_methode_plus
    writecolumbs()
  File "/Users/Danny/Desktop/Inventaris.py", line 21, in writecolumbs
    with open("variabelen.csv", "wb") in csvfile:
TypeError: argument of type 'file' is not iterable
>>> 

这是给我错误的代码:

^{pr2}$

csv文件当前包含以下信息: 产品名称 233 60个 2234 1号


Tags: 文件csvinpy错误lineplususers

热门问题