file = open("Whatever.txt","r") somestring = str(file.readline()) # Read in the whole line as a string somestring = str(file.readline()).splitlines()[0] # Avoid it reading in a line break (not sure why this only sometimes happens) x,y,z = line.split() # Read in multiple parameters from a line (must be separated by whitespace) for line in file: # Read in whole file of three variables x,y,z = line.split() x = float(x) y = float(y) z =float(z) file.close()