random number generation


(chacademus) #1

How do you generate a random number using python?


(theeth) #2

from random import random

rnd = random() # this is a random number being assigned to a variable

or try the dynoise module from http://www.stormpages.com/eeshlo/VariousPython.html



from dynoise import random

rnd = random() # this is a random number being assigned to a variable
rndvec = randvec() # this is a random vector being assigned to a variable

Martin