Random passwords generation (Python vs Perl) =)

Szabolcs Nagy nszabolcs at gmail.com
Mon Jan 29 10:01:39 EST 2007


> If you don't mind possibly getting a few nonalphanumeric characters:
>
> import os,binascii
> print binascii.b2a_base64(os.urandom(6))

what about

file('/dev/urandom').read(6).encode('base64')

(oneliner and without import as op requested)




More information about the Python-list mailing list