IOError:[Errno 22] 无效模式('r')或文件名:'E:\x07nu\meta.csv'
f = open("E:\anu\meta.csv","r")
for line in file:
x = line.split(",")
print(x[0])
最佳答案
\a 正在制造问题。\a 和\t 等字符会产生此类问题。
改用原始字符串:
test_file=open(r'E:\anu\meta.csv','r')
或双斜杠:
test_file=open('E:\\anu\meta.csv','r')
或改用正斜杠:
test_file=open('E:/anu/meta.csv','r')
关于windows - IO错误 : [Errno 22] invalid mode ('r' ) or filename: 'E:\x07nu\meta.csv' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37914570/