# tqdm

用于进度条使用、可视化进度

```python
from time import sleep
from tqdm import tqdm

# 这里同样的，tqdm就是这个进度条最常用的一个方法
# 里面存一个可迭代对象
for i in tqdm(range(1, 50)):
    # 模拟你的任务
    sleep(0.01)

# 这里会分4个阶段0-25%显示a，1/4等
bar = tqdm(["a", "b", "c", "d"])
for char in bar:
    bar.set_description("Processing %s" % char) # 添加描述
    sleep(1)

'''
100%|██████████| 49/49 [00:00<00:00, 88.16it/s]
Processing d: 100%|██████████| 4/4 [00:04<00:00,  1.00s/it]
'''
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://im-qianuxn.gitbook.io/pytorch/ji-suan-ji/python/tqdm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
