problem with eval and time

Dave Angel d at davea.name
Tue Nov 6 05:42:42 CET 2012


On 11/05/2012 11:29 PM, Wincent wrote:

(Please don't top-post.  it messes everything up.  And your use of
Google-groups is making everything double-spaced)

> Thanks.
>
> I fetch data from social networking sites and want to mark the time of access. I store all the information in a redis database, which converts everything into strings and I need to convert those strings back to original python objects when analyzing the data.
>

Then restate your problem in terms of describing these strings. 
Apparently you don't get them from

str(time.localtime()), but from some redis methodology.

To convert most reasonable strings back to a date/time, you can probably use strftime.

But you certainly cannot reasonably use eval.  You're lucky it didn't work, so you didn't leave it that way.  Eval on data stored in some database?  You gotta be kidding.

<snip all the stuff that followed your message, since you obviously
didn't care about it>

-- 

DaveA



More information about the Python-list mailing list