with open('topology_list.txt') as topo_file: for line in topo_file: print line, # The comma to suppress the extra new line char