On 6/21/10 3:54 PM, davidgp wrote: > i basically tried this: > lat =0.0 > for line in f: > lat = float(line) > > but this gives an error.. does anyone know what i should to do? > thanks,
"An error"? Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> f = open("test.txt", "r") >>> for line in f: ... print float(line) ... 52.2375412 5.1802704 Always include what the actual error is that you're running into. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list