Thanks, but I`m still far from for dose details I thing:) Regards
Anatoli On Tue, Mar 27, 2012 at 5:53 PM, Tim Chase <python.l...@tim.thechases.com>wrote: > On 03/27/12 10:32, Prasad, Ramit wrote: > >> fileread = open('myfile.txt','r') >>> tbook = eval(fileread.read()) >>> fileread.close() >>> >> >> The use of eval is dangerous if you are not *completely* sure what is >> being passed in. Try using pickle instead: >> http://docs.python.org/**release/2.5.2/lib/pickle-**example.html<http://docs.python.org/release/2.5.2/lib/pickle-example.html> >> > > Or, depending on the use, you might use ast.literal_eval() > > A cursory glance at the OP's code suggests that this may simply be a dict > of values-to-lists of purely literals, so literal_eval() should do the job. > > -tkc > > > -- > http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list> >
-- http://mail.python.org/mailman/listinfo/python-list