I tried to create a progress bar to view progress of file transferring by using the below code.
from tqdm import tqdm
import pysftp
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None
srv = pysftp.Connection(host=host,username=username,password=password,cnopts=cnopts)
with tqdm(unit = 'blocks', unit_scale = True, leave = False, miniters = 1, desc = 'Uploading......', total = filesize) as tqdm_instance:
srv.put("D:\\wp-deploy.jpg","/var/www/html/wp-deploy.jpg",callback=lambda sent:tqdm_instance.update(len(sent)))
and I got this error:
TypeError: <lambda>() takes 1 positional argument but 2 were given
From the docs: