Python Progress Bar Escalation
from tqdm import tqdm_notebook as tqdm from tqdm import tqdm with tqdm(total=len(values), file=sys.stdout) as pbar: for i in range(1000): if i % 100 == 0: print(i) for i in range(1000): print(i) $ python main.py > log.txt & $ cat log.txt | wc -l
A four-panel expanding-brain meme shows increasingly elaborate ways to process or monitor a Python loop. It escalates from importing tqdm, to using a progress bar, to manually printing periodic updates, and finally redirecting output to a file and counting its lines. The joke is that the simplest shell-based solution is portrayed as the most enlightened.
code editor / редактор кодаPython code / код Pythonprogress bar / индикатор прогрессаbrain scan / снимок мозгаglowing brain / светящийся мозгhuman head profile / профиль человеческой головыterminal window / окно терминалаtext file / текстовый файлcommand line / командная строкаblue cosmic figure / синяя космическая фигураloop / циклprinted numbers / напечатанные числа
- @profunctor_io / 674 2018-03-01
- @right_wing_dev_squads / 10412 2024-09-04
- Template
- Expanding Brain
- Type
- image
- Size
- 666×707 · 81.4 KiB
- Mood
- absurd, clever
- Language
- en
- Added