os.urandom(20)
Saves you from having to manage files at all, and works cross-platform.
In production code I would probably use Crypto.Random.get_random_bytes().
In production code I would probably use Crypto.Random.get_random_bytes().