您好,我從一個CSV文件的信息,但在打開文件的錯誤構建路徑文件蟒蛇從路徑打開的文件生成
No such file or directory: 'C:\\New folder\\a\\\xef\xbb\xbf90305.xlsx'
當我打印的文件名顯示
C:\New folder\a\90305.xlsx
請幫助
with open (r'C:\New folder\li.csv','rb')as csvfile:
spamreader=csv.reader(csvfile,delimiter=',')
for row in spamreader:
filename = r'C:\New folder\a'
suffix='.xlsx'
filename=os.path.join(filename,row[0]+suffix)
with open(filename,"rb")as fo:
print fo