我有这个脚本:
#!/usr/bin/python
import csv
import sys
csv_file = csv.reader(open('sample_1.csv', "rb"), delimiter=';')
csv_file_sounds = csv.reader(open('sample_2.csv', "rb"), delimiter=';')
for row in csv_file:
for row2 in csv_file_sounds:
if row2[21] == row[0]:
print row2[15]
" for csv_file"循环只运行一次,但我在sample_1.csv
中有很多行。我错过了什么?我想在sample_1.csv
sample_2.csv
个字符串
(英语不是我的母语;请原谅我的任何错误。)