Extracting minimum and maximum x-values Python
<p>i've written a function that takes a file with x,y coordinates as input, and simply show the coordinates in python. I want to work a bit more with the coordinates and here is my problem:</p>

<p>for example after reading a file i get:</p>

<pre><code>32, 48.6
36, 49.0
30, 44.1
44, 60.1
46, 57.7
</code></pre>

<p>and i want to extract the minimum and the maximum x-value.</p>

<p>My function to read the file is like this:</p>

<pre><code>def readfile(pathname):
    f = open(sti + '/testdata.txt')
    for line in f.readlines():
        line = line.strip()
        x, y = line.split(',')
        x, y= float(x),float(y)
        print line
</code></pre>

<p>i was thinking something like creating a new function with min() and max() but as im pretty new to python im a bit stuck.</p>

<p>if i for instance call min(readfile(pathname)) it just reads the whole file again..</p>

<p>Any hints is highly appreciated:)</p>
