Random passwords generation (Python vs Perl) =)

Hieu.D.Hoang at gmail.com Hieu.D.Hoang at gmail.com
Tue Jan 30 23:08:28 EST 2007


On Jan 30, 5:07 am, "NoName" <zaz... at gmail.com> wrote:
> WOW! :shock:
>
> in this case:
>
> while 1:i=__import__;print
> i('binascii').b2a_base64(i('os').urandom(6)),;raw_input()
>
> > :)

raw_input can do the job of print
while 1: raw_input(__import__('os').urandom(6).encode('base64'))

And can anyone explain why this is so?
>>> while 1: input(__import__('os').urandom(6).encode('base64'))
...
BgiWdv//

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 0

    ^
SyntaxError: unexpected EOF while parsing

Thank to all, I learned a lot of new things from this thread.

Hieu




More information about the Python-list mailing list