"Szabolcs Nagy" <nszabolcs at gmail.com> writes: > file('/dev/urandom').read(6).encode('base64') > (oneliner and without import sa op requested) Nice, though Un*x dependent (os.urandom is supposed to be portable).