dimanche 2 juillet 2017

Best way to generate random number on Linux / Python3.5

What is the best way to generate random numbers on Linux, to have the more random number as possible the pseudo-generator can give us.

I have seeded my random generator like this:

random.seed(a=os.urandom(512), version=2)

Then I am trying to fill up an array with binary values [0,1]:

randarray=[]

for i in range(X): randarray.append(        int (round(random.uniform(0, 1) ,0))                )

Am I doing this correctly, if not please help me out.




Aucun commentaire:

Enregistrer un commentaire