Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/tqdm/autonotebook.py @ 68:5028fdace37b
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 16:23:26 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
67:0e9998148a16 | 68:5028fdace37b |
---|---|
1 """ | |
2 Automatically choose between `tqdm.notebook` and `tqdm.std`. | |
3 | |
4 Usage: | |
5 >>> from tqdm.autonotebook import trange, tqdm | |
6 >>> for i in trange(10): | |
7 ... ... | |
8 """ | |
9 import sys | |
10 from warnings import warn | |
11 | |
12 try: | |
13 get_ipython = sys.modules['IPython'].get_ipython | |
14 if 'IPKernelApp' not in get_ipython().config: # pragma: no cover | |
15 raise ImportError("console") | |
16 from .notebook import WARN_NOIPYW, IProgress | |
17 if IProgress is None: | |
18 from .std import TqdmWarning | |
19 warn(WARN_NOIPYW, TqdmWarning, stacklevel=2) | |
20 raise ImportError('ipywidgets') | |
21 except Exception: | |
22 from .std import tqdm, trange | |
23 else: # pragma: no cover | |
24 from .notebook import tqdm, trange | |
25 from .std import TqdmExperimentalWarning | |
26 warn("Using `tqdm.autonotebook.tqdm` in notebook mode." | |
27 " Use `tqdm.tqdm` instead to force console mode" | |
28 " (e.g. in jupyter console)", TqdmExperimentalWarning, stacklevel=2) | |
29 __all__ = ["tqdm", "trange"] |