I know how to set the random seed in python
random.seed([x])
Once the seed is set is there any way to read it back and figure out what value was passed to the seed() function?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
While the underlying algorithm for Python’s Random (Mersenne Twister) is deterministic, the seed is not stored anywhere in the implementation’s memory space. It is up to the caller to store the seed, if necessary.
http://docs.python.org/library/random.html#module-random
For more info on Python’s implementation (or to override it with your own seed storing random class) see:
http://hg.python.org/cpython/file/0b650272f58f/Lib/random.py
and
http://hg.python.org/cpython/file/0b650272f58f/Python/random.c