parsing CSV files with quotes

Fredrik Lundh effbot at telia.com
Thu Mar 30 12:29:04 EST 2000


Warren Postma <embed at geocities.com> wrote:
> Another is that any code with eval() can do "way more than I intended" by
> calling eval, since eval() is basically opening up the entire parser.
>
> Is there some code to do eval_literals_only() that knows about parsing
> literal expressions but which can't be made to call any functions?

value = eval(expression, {"__builtins__": {}})

for more info, see the eff-bot guide.

</F>

<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list