for line in infile:
    data = [tryconvert(x, int, float) for x in line.split()]
Python: How can I read in the characters from a line in a file and convert them to floats and strs, depending on if they are numbers or letters?