Somedays ago, I read a blog post about useful python library and I found cool library.
The name of library was ‘tqdm’.
The library can visualise progress bar very easily.
For example, if I want to visualise progress of loops, I could do it only call tqdm.
That’s all. ;-)
Then I could get following progress bar.
Hmm That’s cool.
In [1]: from rdkit import Chem In [2]: from tqdm import tqdm In [3]: sdf = Chem.SDMolSupplier( 'cdk2.sdf' ) In [4]: mols = [ mol for mol in tqdm( sdf ) ] 100%|█████████████████████████████████████████| 47/47 [00:00<00:00, 1081.43it/s]
In [8]: for mol in tqdm( mols ): ...: print( Chem.MolToSmiles( mol ) ) ...: 0%| | 0/47 [00:00<?, ?it/s]CC(C)C(=O)COc1nc(N)nc2[nH]cnc12 Nc1nc(OCC2CCCO2)c2nc[nH]c2n1 Nc1nc(OCC2CCC(=O)N2)c2nc[nH]c2n1 Nc1nc(OCC2CCCCC2)c2nc[nH]c2n1 ~~~~~~~~~cut~~~~~~~~~~~~~~~~ O=C1Nc2ccc3ncsc3c2C1=CNc1ccc(S(=O)(=O)Nc2ccccn2)cc1 100%|█████████████████████████████████████████| 47/47 [00:00<00:00, 3283.24it/s]