I want to read a list of IDs (as integers) from a file in Python3. The file has a single ID per line and no blank lines.
with open(file_eval_id) as f:
eval_ids = [list(map(int, line.split()))[0] for line in f]
Is there a cleaner way of doing it? I have doubts about referencing the list(...)[0]
as the best way.