Advise of programming one of my first programs
tolidtm at gmail.com
Tue Mar 27 23:53:42 CEST 2012
Thanks, but I`m still far from for dose details I thing:)
On Tue, Mar 27, 2012 at 5:53 PM, Tim Chase <python.list at tim.thechases.com>wrote:
> On 03/27/12 10:32, Prasad, Ramit wrote:
>> fileread = open('myfile.txt','r')
>>> tbook = eval(fileread.read())
>> The use of eval is dangerous if you are not *completely* sure what is
>> being passed in. Try using pickle instead:
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list