reading and writing files

Chris Rebert clp2 at rebertia.com
Wed Aug 24 02:38:12 EDT 2011


On Tue, Aug 23, 2011 at 11:29 PM, Muresan Alexandru Mihai
<muresanalex.contact at gmail.com> wrote:
> If you need an int isn't better to use input() instead of raw_input() ?

Absolutely not! input() does an eval(), which is very dangerous
security-wise and can also lead to rather strange behavior.
input() is so bad that it was removed in Python 3 (confusingly,
raw_input() was also simultaneously renamed to input(); the point is,
there's no longer an equivalent built-in function).

Cheers,
Chris



More information about the Python-list mailing list