News for hackers. Stuff that matters.
Re:Python 2.x vs. 3.x use survey by thusoy on Wednesday December 10, 2014 @03:54PM (#8731622)
The easiest version is the most portable and easy to read in this case:

os.urandom(20)

Saves you from having to manage files at all, and works cross-platform.

Re:Python 2.x vs. 3.x use survey by schoen on Wednesday December 10, 2014 @10:54PM (#8733105)
Huh, I never knew that was there; thanks!

In production code I would probably use Crypto.Random.get_random_bytes().