def qrandom ( n ) : import quantumrandom return np . concatenate ( [ quantumrandom . get_data ( data_type = 'uint16' , array_length = 1024 ) for i in range ( int ( np . ceil ( n / 1024.0 ) ) ) ] ) [ : n ]
how to get real quantum random values python
Creates an array of n true random numbers obtained from the quantum random number generator at qrng . anu . edu . au
def qrandom(n):
  """
  Creates an array of n true random numbers obtained from the quantum random
  number generator at qrng.anu.edu.au

  This function requires the package quantumrandom and an internet connection.

  Args:
    n (int):
      length of the random array

  Return:
    array of ints:
      array of truly random unsigned 16 bit int values
  """
  import quantumrandom
  return np.concatenate([
    quantumrandom.get_data(data_type='uint16', array_length=1024)
    for i in range(int(np.ceil(n/1024.0)))
  ])[:n]