我是 Python 的新手,我想编写一个 csv 文件,其中列出了我的方程式的根。 我正在研究 Sage。 我的代码是:
with open('out.csv', 'w') as f:
c = csv.writer(f)
c.writerows(root)
我收到的错误是“NameError: name 'csv' is not defined”
有人可以帮忙吗?
最佳答案
csv
不是内置的,尽管它是标准库的一部分。您需要导入它:
import csv
# your code
关于python - 名称错误 : name 'csv' is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44953012/