I\'m having problems with Python\'s import random function. It seems that import random and from random import random are importing different thing
import random
includes the module into the namespace under the name 'random'.
from random import random
includes the function'random' from the namespace 'random' into the global namespace.
So in the first example, you would call random.random, and in the second, you would call random. Both would access the same function.
Similarly,
from random import randint
would import randint into the global namespace, so you could simply call randint instead of random.randint.