我正在尝试创建一个现有的字典并将其写入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号
在第21行写入
as csvfile
而不是in csvfile
。在python中的
in
关键字后面跟一个iterable,这就是为什么您会收到错误消息。在相关问题 更多 >
编程相关推荐