from ftplib import FTPf = FTP('ftp.kernel.org')f.login()f.cwd('/pub/linux/kernel')entries = []f.dir(entries.append)print "%d entries:" % len(entries)for entry in entries: print entryf.quit()