Probably a simple question, but I'm just getting started with Python and try to understand how the library stuff works.
So my question is why do I need to type
from tqdm import tqdm
instead of just
import tqdm
like with other libraries?
I get that when you only need one part of a library you can do this. But in this case my program doesn't work if I don't do it. Shouldn't be everything included with the second expression? If I run my program with it I get the error:
"TypeError: 'module' object is not callable"
The package tqdm
has a module named tqdm
inside it. Now to your tqdm
you can
tqdm
and use the module called tqdm
by:import tqdm
for i in tqdm.tqdm(range(10)):
pass
OR
tqdm
module of the tqdm
package by:from tqdm import tqdm
for i in tqdm(range(10)):
pass