read lines

Zepo Len no at no.no
Tue Dec 4 08:36:20 EST 2007


> Your regex is not working correctly I guess, I don't even know why you  
> are using a regex, something like this would work just fine:
>
> import sys
> nums = [float(line.split(' -')[1]) for line in open(sys.argv[1])]
> print 'min=', min(nums), 'max=', max(nums)

Sorry, that should be line.split() - didn't realise those were negative  
numbers.



More information about the Python-list mailing list