random.seed()

random.seed(a=None, version=2)

Initialize the random number generator.

If a is omitted or None, the current system time is used. If randomness sources are provided by the operating system, they are used instead of the system time (see the os.urandom() function for details on availability).

If a is an int, it is used directly.

With version 2 (the default), a str, bytes, or bytearray object gets converted to an int and all of its bits are used. With version 1, the hash() of a is used instead.

Changed in version 3.2: Moved to the version 2 scheme which uses all of the bits in a string seed.

doc_python
2016-10-07 17:41:09
Comments
Leave a Comment

Please login to continue.