I'm wondering what the easiest source of randomness inside a pypy sandbox is.
Things I've tried:
- Random library
- Time library
- Reading from /dev/random
- os.urandom()
The best solution I have now is to make a class which is initialized with a seed, and this seed is just incremented every time the instance is asked for a random number, and using some pseudo-random generation algorithm. I don't need very good randomness, so this isn't terrible, but it still seems pretty ugly.
I believe anything in pure Python should work.
Aucun commentaire:
Enregistrer un commentaire