[Python] How to query seed used by random.random()?

Discussão em 'Python' iniciado por Stack, Abril 29, 2025.

  1. Stack

    Stack Membro Participativo

    Is there any way to find out what seed Python used to seed its random number generator?

    I know I can specify my own seed, but I'm quite happy with Python managing it. I want to know what seed it used, so that if I like the results I'm getting in a particular run, I could reproduce that run later. If I had the seed that was used then I could.

    If the answer is I can't, then what's the best way to generate a seed myself? I want them to always be different from run to run - I just want to know what was used.

    Continue reading...

Compartilhe esta Página