How to write if/else in one line.
What's the simplest way of read in CSV file? import csv
CSVRead = csv.reader(open(CSV_D, 'rU')) CSV = ['>' + x[0] + '.' + x[1] + '\n' + x[2] + '\n' for x in CSVRead] Attention: 'rU' is important. It will ignore whether the line feed character is '\n' or \r'. |