Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32794

problem with eval and time

Newsgroups comp.lang.python
Date 2012-11-05 19:32 -0800
Message-ID <932c348a-2670-44f0-a38b-4fddae577a0e@googlegroups.com> (permalink)
Subject problem with eval and time
From Wincent <ronggui.huang@gmail.com>

Show all headers | View raw


Dear all, I would like to convert tstr to representation of time, but encounter the following error. Is there a simple way to get what I want? Thanks.

>>> import time
>>> tstr = str(time.localtime())
>>> eval(tstr)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1, in <module>
TypeError: structseq() takes at most 2 arguments (9 given)
>>> sys.version
'2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]'

Wincent

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

problem with eval and time Wincent <ronggui.huang@gmail.com> - 2012-11-05 19:32 -0800
  Re: problem with eval and time alex23 <wuwei23@gmail.com> - 2012-11-05 20:22 -0800
    Re: problem with eval and time Wincent <ronggui.huang@gmail.com> - 2012-11-05 20:29 -0800
      Re: problem with eval and time Chris Angelico <rosuav@gmail.com> - 2012-11-06 15:38 +1100
      Re: problem with eval and time Dave Angel <d@davea.name> - 2012-11-05 23:42 -0500
  Re: problem with eval and time Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-06 00:06 -0500

csiph-web