首页> 开发问题 >其它问题 其它问题
TypeError: 'newline' is an invalid keyword argument for this function 错误解决
作者:小萝卜 2019-12-06 【 漏洞BUG 】 浏览 1922
简介TypeError: 'newline' is an invalid keyword argument for this function 错误解决
出错代码:
outputFile = open('output1.csv', 'w', newline='') # error line
outputWriter = csv.writer(outputFile)
使用newline=''是为了避免行距两倍的情况。
解决方法:
outputFile = open('output1.csv', 'wb') # 'w' ---> 'wb'
很赞哦! (0)
相关文章
- 解决:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile
- ImportError: cannot import name 'BaseDataset' from 'src.dataset'
- Attempt to invoke interface method 'boolean java.util.List.add(java.lang.Object)' on a null object reference
- 关于windows10上的sourcetree突然打不开的问题的解决策略
- Python问题:SyntaxError: Non-ASCII character '\xe2' in file
- Python运行语法错误:IndentationError: unindent does not match any outer indentation level
- Java compiler level does not match the version of the installed Java project facet
- Android Studio安装&&安装bug
- MATLAB关闭科学计数法显示
- matlab命令行双箭头消失
