Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

tqdm: add examples #15751

wants to merge 6 commits into from

Conversation

BuonOmo
Copy link
Contributor

@BuonOmo BuonOmo commented Feb 18, 2025

  • The page(s) are in the correct platform directories: common, linux, osx, windows, sunos, android, etc.
  • The page(s) have at most 8 examples.
  • The page description(s) have links to documentation or a homepage.
  • The page(s) follow the content guidelines.
  • The page(s) follow the style guide.
  • The PR title conforms to the recommended templates.
  • Version of the command being documented (if known): v4.67.1

@github-actions github-actions bot added page edit Changes to an existing page(s). review needed Prioritized PRs marked for reviews from maintainers. labels Feb 18, 2025
@tldr-bot

This comment was marked as resolved.

@BuonOmo BuonOmo force-pushed the tqdm branch 2 times, most recently from 7d19cdc to faca4b0 Compare February 18, 2025 16:02
@Managor
Copy link
Collaborator

Managor commented Mar 25, 2025

I think it's time to return to this PR now that a lot of things have been resolved.


- Create an archive out of a directory and use the file count of that directory to create a progress bar:

`zip -r {{backup.zip}} {{dir}} | tqdm --total $(find {{dir}} | wc -l) --unit files --null`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`zip -r {{backup.zip}} {{dir}} | tqdm --total $(find {{dir}} | wc -l) --unit files --null`
`zip -r {{path/to/archive.zip}} {{path/to/directory}} | tqdm --total $(find {{path/to/directory}} | wc -l) --unit files --null`

Sadly this makes the command longer but hopefully it clarifies things

- Create a progress bar:

`seq 10000000 | tqdm --total 10000000 --null`
`{{seq 10000000}} | tqdm --total 10000000 | {{command}}`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`{{seq 10000000}} | tqdm --total 10000000 | {{command}}`
`{{seq 10000000}} | tqdm --total {{10000000}} | {{command}}`

@Managor
Copy link
Collaborator

Managor commented Mar 28, 2025

We could use tar as the fourth example and use tricks to pipe stderr into stdout together to make it platform agnostic (not sure if 2>&1 or |& is available on all platforms).

Also it would be good if the description noted that it is platform agnostic.

@MachiavelliII

This comment was marked as off-topic.

@Managor

This comment was marked as off-topic.

@MachiavelliII

This comment was marked as off-topic.

@Managor

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
page edit Changes to an existing page(s). review needed Prioritized PRs marked for reviews from maintainers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants