TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Tqdm (Python)

738 pointsby manjanaover 3 years ago

33 comments

BiteCode_devover 3 years ago
I really love the wave of new tools that are gaining traction in the Python world: tqdm, rich (and soon textual), fastpi, typer, pydantic, shiv, toga, doit, diskcache...<p>With the better error messages in 3.10 and 11, plus the focus on speed, it&#x27;s a fantastic era for the language and it&#x27;s a ton of fun.<p>I didn&#x27;t expect to find back the feeling of &quot;too-good-to-be-true&quot; I had when starting with 2.4, and yet.<p>In fact, being a dev is kinda awesome right now, no matter where you look. JS and PHP are getting more ergonomics, you get a load of new low level languages to sharpen your hardware, Java is modern now, C# runs on Unix, the Rust and Go communities are busy with shipping fantastic tools (ripgrep, fdfind, docker, cue, etc), windows has a decent terminal and WSL, my mother is actually using Linux and Apple came up with the M1. IDEs and browsers are incredible, and they do eat a lot of space, but I have a 32 Go RAM + 1TO SSD laptop that&#x27;s as slim as a sheet of paper.<p>Not to mention there is a lot of money to be made.<p>I know it&#x27;s trendy right now to say everything is bad in IT, but I disagree, overall, we have it SO good.
评论 #29584318 未加载
评论 #29582946 未加载
评论 #29583453 未加载
评论 #29584941 未加载
评论 #29583197 未加载
评论 #29586419 未加载
评论 #29587564 未加载
评论 #29585436 未加载
评论 #29582974 未加载
评论 #29589070 未加载
评论 #29590251 未加载
评论 #29585708 未加载
评论 #29587324 未加载
评论 #29583921 未加载
jasonpeacockover 3 years ago
Might as well toss out Plumbum: <a href="https:&#x2F;&#x2F;plumbum.readthedocs.io&#x2F;en&#x2F;latest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;plumbum.readthedocs.io&#x2F;en&#x2F;latest&#x2F;</a><p>No more bash! No more subprocess! Write shell-like code with the convenience of Python!<p>Seriously, it&#x27;s a great module. A bit of a learning curve, but then it feels natural.
评论 #29586063 未加载
评论 #29586318 未加载
评论 #29584552 未加载
评论 #29584581 未加载
评论 #29584097 未加载
ejdyksenover 3 years ago
If you like tqdm, it&#x27;s worth checking out pqdm, a parallelized version. If you have embarrassingly parallel work to process in a script, it makes it dead simple to parallelize <i>and</i> monitor the progress of something. Highly recommend:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;niedakh&#x2F;pqdm" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;niedakh&#x2F;pqdm</a>
评论 #29586892 未加载
评论 #29601390 未加载
Nihilartikelover 3 years ago
One library that haa been really useful for me lately is Dataset <a href="https:&#x2F;&#x2F;dataset.readthedocs.io&#x2F;en&#x2F;latest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dataset.readthedocs.io&#x2F;en&#x2F;latest&#x2F;</a><p>It makes it a lot easier to casually use a database (e.g. SQLite) to persist dictionaries without explicitly building a schema.<p>Great for CLI apps and ad hoc data crunching.
999900000999over 3 years ago
Python is such an amazing language, on one hand, it&#x27;s easy enough where you could probably train a non technical person on it within about two months.<p>Yet, you can still make 200K writing it, I don&#x27;t know the next time I&#x27;ll create a command line application in Python, but I&#x27;ll keep this little tool in mind. I hope Python eats the world.
评论 #29586359 未加载
pakover 3 years ago
Big fan of tqdm in python, so I ported it to ruby 5 years ago:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;powerpak&#x2F;tqdm-ruby" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;powerpak&#x2F;tqdm-ruby</a><p>(shameless plug and an invitation for pull requests)
评论 #29589116 未加载
perrygeoover 3 years ago
Check out Will Chrichton&#x27;s talk &quot;Type-Driven API Design in Rust&quot; where he live-codes a tqdm-like progress bar for Rust iterators. Solid presentation and eye-opening how straightforward it was to extend the core language through traits.
评论 #29586071 未加载
curiousgalover 3 years ago
Fun fact, tqdm has an official (pre-alpha) C++ port!<p><a href="https:&#x2F;&#x2F;github.com&#x2F;tqdm&#x2F;tqdm.cpp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tqdm&#x2F;tqdm.cpp</a>
teddyhover 3 years ago
See also the shell command pv(1).
评论 #29604222 未加载
dwaterover 3 years ago
tqdm &amp; click make a nice CLI pairing for taking a simple idea and turning into a reusable tool that you can feel good about sharing in minutes.
评论 #29583108 未加载
评论 #29583006 未加载
评论 #29585061 未加载
评论 #29591334 未加载
评论 #29592080 未加载
minimaxirover 3 years ago
tqdm is one of the very few Python packages that makes it into every script I write. It&#x27;s a very high ROI for managing and tracking simple loops.<p>My only complaint is the smoothing parameter; by default it predicts the estimated time remaining based on the most recent updates so it can fluctuate wildly; smoothing=0 predicts based on the total runtime which makes more sense given law of large numbers.
评论 #29584142 未加载
评论 #29583700 未加载
评论 #29582843 未加载
drexlspiveyover 3 years ago
It has no dependencies which is pretty cool
enriqutoover 3 years ago
Is there a way to globally disable all tqdm progress bars?<p>Something like the NO_COLOR environement variable?<p>These progress bars are nice when you launched a single loop yourself, but when you are running an automated battery of many things they become annoying and pollute your terminal too much. I know that you can silence each particular program that uses tqdm by setting a &#x27;disable&#x27; option. But this requires editing the python source code of the program.
评论 #29592234 未加载
emehexover 3 years ago
chime [1] is another python package that fans of tqdm might like.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;MaxHalford&#x2F;chime&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;MaxHalford&#x2F;chime&#x2F;</a>
oarsover 3 years ago
Fantastic share and subsequent discussion about in this thread. Threads like these are why I love HN.<p>My Python skills have improved so much thanks to HN.
avelisover 3 years ago
I always wondered how a post like this a year ago didn&#x27;t go anywhere but this post makes the front page. Love the Python package. <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23160774" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23160774</a>
nurettinover 3 years ago
I like how tqdm can manage multiple progressbars in the same terminal. I have used it to track the progress of multi day processes. It also produces a nice animation on jupyter notebooks.
debo_over 3 years ago
I just had the pleasant experience of importing tqdm into a script, checking HN, and seeing tqdm here :)
tmabrahamover 3 years ago
Tqdm is awesome and I use it all the time!<p>Another great alternative is fastprogress: <a href="https:&#x2F;&#x2F;github.com&#x2F;fastai&#x2F;fastprogress" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;fastai&#x2F;fastprogress</a><p>It often works better in Jupyter Notebooks.
评论 #29589881 未加载
hathymover 3 years ago
Do you know that tqdm is pronounced like the Arabic word تقدم which mean progress?
评论 #29589466 未加载
MapleWalnutover 3 years ago
I wish there was something this good for Golang.
评论 #29584024 未加载
mark_l_watsonover 3 years ago
I thought the name was familiar: I use it with TensorFlow. Nice project!
keithalewisover 3 years ago
Whoaaaa, this tqdm thing is, like, um, toats kewl!!! It&#x27;s waaay better than the &lt;blink&gt; tag old people used to use, like, before I was even born lol. IM so so happy idont have to think too hard to get flashing light thingys to show up on my screen.
评论 #29589076 未加载
k_szeover 3 years ago
tqdm is one of the (many) really useful packages that make me miss using Python (I’m stuck writing TypeScript for Node.js in my current job).
评论 #29599344 未加载
atum47over 3 years ago
Love tqdm, I used to use it on all my python scripts.
ya3rover 3 years ago
tqdm is really great. (Also great name BTW) It has a lot of features like cli, jupter notebook widget, flexibility, etc.<p>I have been using it for 4-5 years now.
1-6over 3 years ago
tqdm also works on Colab (Jupyter Notebooks) yay
评论 #29582887 未加载
ameliusover 3 years ago
I think the author doesn&#x27;t fully appreciate how insanely difficult it is to write accurate progress meters for anything slightly more complicated than a single for-loop.
djsteinover 3 years ago
this looks like a fantastic tool! would love to use this in some Python CLI&#x27;s to help users understand the progress
davidatbuover 3 years ago
tqdm is great, except I really like my type hints, and tqdm has no type hints :(
mrfusionover 3 years ago
How would it know how long a loop is ahead of time? Is this solving the halting problem?
评论 #29584556 未加载
评论 #29584473 未加载
评论 #29583820 未加载
blahgeekover 3 years ago
Wait.. so python takes several seconds to simply count from 0 to 9 million?
exizt88over 3 years ago
Hey, I know this is a bit off-topic, but I can&#x27;t wrap my mind around one thing. I&#x27;m getting a ton of Google ads on that website. Where do they come from? Is Github adding them? Did the devs add them to their docs?
评论 #29590997 未加载