D
D
Dauren S2019-06-26 07:42:51
Python
Dauren S, 2019-06-26 07:42:51

Display list of ftp files in python?

# -*- coding: UTF-8 -*-
from ftplib import FTP
ftp = FTP(key)
ftp.login(item['login'], item['pass'])
ftp.cwd(item['path'])

How to display a list of ftp files in a loop showing only the name and size of the file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dauren S, 2019-06-26
@dauren101

files=ftp.nlst()
            for f in files:
                print(ftp.size(f))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question