reading a list from a file

Jordan Rastrick jrastrick at student.usyd.edu.au
Mon Jun 20 18:06:04 EDT 2005


Be careful, though - make sure you can absolutely trust your source of
data before calling eval on it.

If an unauthorised person could forseeably modify your file, then they
could insert a string containing arbitrary Python code into it in place
of your list, and then running your program would cause that code to be
executed.

So, to put it bluntly, eval is dangerous.

Sure is convenient, though :)




More information about the Python-list mailing list