-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tqdm: add examples #15751
base: main
Are you sure you want to change the base?
tqdm: add examples #15751
Conversation
The build for this PR failed with the following error(s):
Please fix the error(s) and push again. |
7d19cdc
to
faca4b0
Compare
> More information: <https://tqdm.github.io/>. | ||
|
||
- Show iterations per second and use stdout afterwards: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Show iterations per second and use stdout afterwards: | |
- Show iterations per second and use `stdout` afterwards: |
|
||
- Specify unit and total: | ||
|
||
`tar -zcf - {{docs/}} | tqdm --bytes --total $(du -sb {{docs/}} | cut -f1) > {{backup.tgz}}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example doesn't work very well. The du
command will output the size of the docs directory, but the size of a gzip-compressed tarball will be smaller than that, and so the progress bar will stop when it reaches the size of the compressed archive instead of 100%.
Here's the final output after compressing some files:
93%|██████████████████████████████▉ | 33.1M/35.4M [00:01<00:00, 31.1MB/s]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer that one ? Also taken from the docs.
7z a -bd -r backup.7z docs/ | grep Compressing | \
tqdm --total $(find docs/ -type f | wc -l) --unit files >> backup.log
common
,linux
,osx
,windows
,sunos
,android
, etc.