パパパパパイソン - はてなダイアリーキーワードもどき import sys, re, csv path_dict, path_data = sys.argv[1], sys.argv[2] encoding = 'cp932' col_keyword, col_data = 1, 3 reader = csv.reader(file(path_dict, "rb")) keyword = [unicode(row[col_keyword], encoding) for row in reader] pattern = re.compile(u"(" + u"|".join(keyword) + u")") for row in csv.reader(file(path_data, "rb")): print pattern.sub(r"(\1)", unicode(row[col_dat