>
> Thank you both options work easily with my problem.
Bryan
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
What about this?
dic = {}
for line in file("findvalue.dat"):
a,b,c,d = line.split()
dic [a] = (float(b), float(c), float(d))
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On 19/10/2007, Bryan Fodness <[EMAIL PROTECTED]> wrote:
> for line in file('findvalue.dat'):
> print[float(x) for x in line.split()]
>
> which returns:
>
> [1.0, 0.80004, 0.91003, 0.879]
> [2.0, 0.86199, 0.93005, 0.92705]
> [3.0, 0.901
On 18/10/2007, Bryan Fodness <[EMAIL PROTECTED]> wrote:
> I have a data file 'data1.dat',
>
> a bc d
>
> 1 0.10.110.111
> 2 0.20.220.222
> 3 0.30.330.333
>
> 9 0.90.990.999
>
> and I want to be able to access the values of b, c,
I have a data file 'data1.dat',
*a* *b**c* *d*
1 0.10.110.111
2 0.20.220.222
3 0.30.330.333
9 0.90.990.999
and I want to be able to access the values of *b*, *c*, or *d* depending on
a value of *a*.
__