with open(open_file) as csvfile: reader = csv.reader(csvfile) for row in reader: lines.append(str(row[0])) random.shuffle(lines) output = open(output_name,'a') for line in lines: input_txt = str(line)+"\n" output.write(input_txt) output.close() print("OK...請打開all_ok_shaf.txt")