I have a console script which uses ftplib as a backend to get a number of files from an ftp server. I would like to use tqdm to give the user some feedback provided they have a "verbose" switch on. This must be optional as some users might use the script without tty
access.
The ftplib's retrbinary
method takes a callback so it should be possible to hook tqdm in there somehow. However, I have no idea what this callback would look like.
if (raw_file.tell() == filesize): tqdm_instance.close()
– Hebrides