T
Tommy Grav
Hi list,
this is somewhat of a newbie question that has irritated me for a
while.
I have a file test.txt:
0.3434 0.5322 0.3345
1.3435 2.3345 5.3433
and this script
lines = open("test.txt","r").readlines()
for line in lines:
(xin,yin,zin) = line.split()
x = float(xin)
y = float(yin)
z = float(zin)
Is there a way to go from line.split() to x,y,z as floats without
converting
each variable individually?
Cheers
Tommy
this is somewhat of a newbie question that has irritated me for a
while.
I have a file test.txt:
0.3434 0.5322 0.3345
1.3435 2.3345 5.3433
and this script
lines = open("test.txt","r").readlines()
for line in lines:
(xin,yin,zin) = line.split()
x = float(xin)
y = float(yin)
z = float(zin)
Is there a way to go from line.split() to x,y,z as floats without
converting
each variable individually?
Cheers
Tommy