On Fri, Jan 16, 2009 at 2:46 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > gert <gert.cuyk...@gmail.com> writes: >> s = urandom(10).encode('hex') >> AttributeError: 'bytes' object has no attribute 'encode' > > Oh, Python 3. It's done some different way, someone else will have to > specify. I'm still using 2.x.
>>> "".join([hex(c) for c in os.urandom(10)]) '0x540x6c0xdf0xd90xe10x7c0x330x370x9a0x8' >>> -- http://mail.python.org/mailman/listinfo/python-list