for in [: ]print( -rw- -- - ftp ftp -rw- -- - ftp ftp -rw- -- - ftp ftp ditto for detailed list mar mar jul -longmont-classes html -longmont-classes html -longmont-classes html on the other handthe server ' using in this section does include the special dot namesto be robustour scripts must skip over these names in remote directory listings just in case they're run against server that includes them (herethe test is required to avoid falling into an infinite recursive loop!we don' need to care about local directory listings because python' os listdir never includes or in its resultbut things are not quite so consistent in the "wild westthat is the internet todayf ftp('learning-python com' login('lutz''xxxxxxxx'for in nlst()[: ]print(xhcc thumbs -public-classes htm -public-classes html [ dir( appendfor in [: ]print(xdrwx--- - drwx--- - drwx -rw---- - -rw---- - output lines omitted includes and here ditto for detailed list may : may : feb : hcc thumbs may : -public-classes htm may : -public-classes html the output of our clean-all script in action followsit shows up in the system console window where the script is run you might be able to achieve the same effect with "rm -rfunix shell command in ssh or telnet window on some serversbut the python script runs on the client and requires no other remote access than basic ftp on the clientc:\pp \internet\ftp\mirrorcleanall py password for lutz on learning-python comconnecting file -public-classes htm file -public-classes html file learning-python-interview doc file python-registration-form- pdf file pythonpoweredsmall gif directory _derived file -public-classes htm_cmp_deepblue _vbtn gif file -public-classes htm_cmp_deepblue _vbtn_p gif file -public-classes html_cmp_deepblue _vbtn_p gif file -public-classes html_cmp_deepblue _vbtn gif directory _vti_cnf client-side scripting