Parsing strings (\n and \\)

Fredrik Lundh fredrik at pythonware.com
Wed Jun 26 04:10:22 EDT 2002


Simo Salminen wrote:

> safe(?) version:
>
> >>> PARSED = eval(UNPARSED, {"__builtins__":None}, {})
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in ?
>   File "<string>", line 0, in ?
> NameError: name '__import__' is not defined

now try this:

UNPARSED = "'*'*10000000*2*2*2*2*2*2*2*2*2"

</F>





More information about the Python-list mailing list