You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to have a progress bar in rsync. The following code partially solves the problem
from tqdm import tqdm
for stdout_line in tqdm(iter(popen.stdout.readline, "")):
...
Indeed, when tqdm is applied to iterators it just shows the number of iterations per second and the elapsed time, unless you specify the parameter total indicating the expected number of iterations.
One could estimate the number of files contained in the src folder, and use the following code:
import os
from tqdm import tqdm
num_files = len([f for f in os.listdir(src) if os.path.isfile(os.path.join(src, f))])
for stdout_line in tqdm(iter(popen.stdout.readline, ""), total=num_files):
...
What do you think?
The text was updated successfully, but these errors were encountered:
It would be useful to have a progress bar in
rsync
. The following code partially solves the problemIndeed, when
tqdm
is applied to iterators it just shows the number of iterations per second and the elapsed time, unless you specify the parametertotal
indicating the expected number of iterations.One could estimate the number of files contained in the
src
folder, and use the following code:What do you think?
The text was updated successfully, but these errors were encountered: