How i can find DIR which is present in last in list
<pre><code>import ftplib  
import re
import string
ftp = ftplib.FTP('')    # For access FTP link.
ftp.login ("")
ftpdir = ftp.cwd('')
data=[]
ftp.dir(data.append)
for line in data:
    string.find("DIR","data")
    if "DIR" in line:
           print line
</code></pre>

<p>With this code i got list of DIR names present in FTP server, now how i can find DIR which is present in last in list.</p>

<p>My output is:               </p>

<pre><code>12-09-11  10:04PM       &lt;DIR&gt;          mcl_201147_hw79u_05
    12-08-11  01:19AM       &lt;DIR&gt;          mcl_201148_hw79u_02
    12-16-11  12:53PM       &lt;DIR&gt;          mcl_201149_hw79u_07
    12-25-11  12:11AM       &lt;DIR&gt;          mcl_201150_hw79u_05
    01-07-12  12:00AM       &lt;DIR&gt;          mcl_201151_hw79u_04
    01-07-12  11:37PM       &lt;DIR&gt;          mcl_201152_hw79u_05
    01-17-12  01:06AM       &lt;DIR&gt;          mcl_201201_hw79u_04
    01-29-12  12:52AM       &lt;DIR&gt;          mcl_201202_hw79u_04
    02-04-12  01:06AM       &lt;DIR&gt;          mcl_201203_hw79u_03
    02-11-12  01:28AM       &lt;DIR&gt;          mcl_201204_hw79u_05
    02-17-12  01:12AM       &lt;DIR&gt;          mcl_201205_hw79u_05
    02-19-12  01:22AM       &lt;DIR&gt;          mcl_201206_hw79u_05
    03-02-12  02:24AM       &lt;DIR&gt;          mcl_201207_hw79u_05
    03-04-12  02:01AM       &lt;DIR&gt;          mcl_201208_hw79u_05
    03-05-12  12:25PM       &lt;DIR&gt;          mcl_201209_hw79u_06
</code></pre>

<p>i want to find last DIR present in list (03-05-12  12:25PM                 mcl_201209_hw79u_06)</p>
