[Python] Library | 03. tqdm

2023. 6. 10. 01:26·Language/Python

tqdm 라이브러리는 반복 루프를 실행시킬 때 얼마까지 진행 되었는지를 나타내기 위해 터미널에 로딩바와 남은 시간을 표시할 수 있게 해줍니다.

 

 tqdm을 사용할 때는 아래와 같이 반복자(iterator)를 인수로 받아 객체를 생성하면 됩니다. 생성된 tqdm 객체도 반복자처럼 사용할 수 있습니다.

import time
import tqdm

iterator = tqdm.tqdm(range(5))

for i in iterator:
	print(i)  # 0, 1, 2, 3, 4
    time.sleep(1)

 

728x90

'Language > Python' 카테고리의 다른 글

[Python] requirements.txt 파일 작성하기  (0) 2025.02.16
[Python] Library | 05. Pydantic  (0) 2025.02.16
[Python] Library | 04. selenium  (0) 2024.01.28
[Python] Library | 02. lmdb  (0) 2023.06.03
[Python] Library | 01. functools  (0) 2023.05.12
'Language/Python' 카테고리의 다른 글
  • [Python] Library | 05. Pydantic
  • [Python] Library | 04. selenium
  • [Python] Library | 02. lmdb
  • [Python] Library | 01. functools
Rayi
Rayi
  • Rayi
    아카이브
    Rayi
  • 전체
    오늘
    어제
    • 분류 전체보기 (262)
      • CS (40)
        • ML (3)
        • CV (2)
        • PS (34)
      • Reveiw (17)
        • Paper (17)
        • Github (0)
      • Pytorch (5)
      • Language (58)
        • Python (7)
        • JavaScript (32)
        • TypeScript (16)
        • C++ (3)
      • IDE (12)
      • Git (13)
      • Frontend (71)
        • React (8)
        • SolidJS (20)
        • CSS (12)
      • UI (3)
      • Backend (15)
        • DB (17)
        • Node.js (11)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    review
    html
    postgresql
    CV
    ts
    Git
    SOLID
    figma
    ML
    vscode
    nodejs
    Three
    ps
    js
    python
    react
    UI
    mongo
    API
    PRISMA
    CS
    C++
    deploy
    backend
    frontend
    DB
    CSS
    Express
    GAN
    PyTorch
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
Rayi
[Python] Library | 03. tqdm
상단으로

티스토리툴바