> If you (the programmer) want a function that asks the user to enter a
> literal at the input prompt, you'll have to write a post-processing for
> it, which looks for prefixes, for quotes, for backslashes, etc., and
> encodes the result.  There very well may be such a decoder in the Python
> library, but input does nothing of the kind.

As it says at the end of eval() (which you definitely don't want to use 
here due to side effects):

See ast.literal_eval() for a function that can safely evaluate strings 
with expressions containing only literals. 

DC


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to