Random passwords generation (Python vs Perl) =)

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Wed Jan 31 03:22:36 EST 2007


In <1170216508.396176.187780 at v33g2000cwv.googlegroups.com>,
Hieu.D.Hoang at gmail.com wrote:

> 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

It's `input()` that expects a valid Python expression.  An empty one
doesn't work, it has to evaluate to something.

In [2]: input()

------------------------------------------------------------
   File "<string>", line 0

     ^
SyntaxError: unexpected EOF while parsing

Ciao,
	Marc 'BlackJack' Rintsch




More information about the Python-list mailing list