################################## The file has the following format name:float1:float2:float3 ################################## def read_file (f): result = [] for line in f: result += line.split(":") return result print read_file(open('sample_file.txt')):