Python论坛  - 讨论区

标题:[python-chinese] 帮忙看一下,哪里出错了?

2006年05月25日 星期四 16:02

肯定来过 rocker.yuan at gmail.com
Thu May 25 16:02:06 HKT 2006

>>> str = time.localtime( 1148007668 )
>>> str
(2006, 5, 19, 11, 1, 8, 4, 139, 0)
>>> for k in str:
...     k = str( k )
...     print k
...
Traceback (most recent call last):
  File "", line 2, in ?
TypeError: 'time.struct_time' object is not callable

-- 
因为你,我才在这沙漠中独步而行…
http://spaces.msn.com/shoujing/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060525/1cf1f9e8/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月25日 星期四 16:04

肯定来过 rocker.yuan at gmail.com
Thu May 25 16:04:14 HKT 2006

对不起,自己弄明白了!耽误大家时间

在06-5-25,肯定来过 <rocker.yuan at gmail.com> 写道:
>
> >>> str = time.localtime( 1148007668 )
> >>> str
> (2006, 5, 19, 11, 1, 8, 4, 139, 0)
> >>> for k in str:
> ...     k = str( k )
> ...     print k
> ...
> Traceback (most recent call last):
>   File "", line 2, in ?
> TypeError: 'time.struct_time' object is not callable
>
> --
> 因为你,我才在这沙漠中独步而行…
> http://spaces.msn.com/shoujing/
>



-- 
因为你,我才在这沙漠中独步而行…
http://spaces.msn.com/shoujing/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060525/c825feca/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月25日 星期四 16:06

头太晕 super852 at gmail.com
Thu May 25 16:06:54 HKT 2006

k = str( k )
这一行错了吧?

在06-5-25,肯定来过 <rocker.yuan at gmail.com> 写道:
>
> 对不起,自己弄明白了!耽误大家时间
>
> 在06-5-25,肯定来过 <rocker.yuan at gmail.com> 写道:
>
> > >>> str = time.localtime( 1148007668 )
> > >>> str
> > (2006, 5, 19, 11, 1, 8, 4, 139, 0)
> > >>> for k in str:
> > ...     k = str( k )
> > ...     print k
> > ...
> > Traceback (most recent call last):
> >   File "", line 2, in ?
> > TypeError: 'time.struct_time' object is not callable
> >
> > --
> > 因为你,我才在这沙漠中独步而行…
> > http://spaces.msn.com/shoujing/
> >
>
>
>
> --
> 因为你,我才在这沙漠中独步而行…
> http://spaces.msn.com/shoujing/
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>


-- 
阿弥陀佛 晕哉 晕哉
--------
欢迎光临我的菜园子:
http://spaces.msn.com/members/headfaint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060525/fb5a4440/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月25日 星期四 16:07

头太晕 super852 at gmail.com
Thu May 25 16:07:52 HKT 2006

我刚才发的那个问题,你能看到吗?我怕发送没成功.

在06-5-25,头太晕 <super852 at gmail.com> 写道:
>
> k = str( k )
> 这一行错了吧?
>
> 在06-5-25,肯定来过 <rocker.yuan at gmail.com> 写道:
>
> > 对不起,自己弄明白了!耽误大家时间
>
> 在06-5-25,肯定来过 < rocker.yuan at gmail.com> 写道:
>
> > >>> str = time.localtime( 1148007668 )
> > >>> str
> > (2006, 5, 19, 11, 1, 8, 4, 139, 0)
> > >>> for k in str:
> > ...     k = str( k )
> > ...     print k
> > ...
> > Traceback (most recent call last):
> >   File "", line 2, in ?
> > TypeError: 'time.struct_time' object is not callable
> >
> > --
> > 因为你,我才在这沙漠中独步而行…
> > http://spaces.msn.com/shoujing/
> >
>
>
>
> --
> 因为你,我才在这沙漠中独步而行…
> http://spaces.msn.com/shoujing/
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to   python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
>
>
> --
> 阿弥陀佛 晕哉 晕哉
> --------
> 欢迎光临我的菜园子:
> http://spaces.msn.com/members/headfaint
>



-- 
阿弥陀佛 晕哉 晕哉
--------
欢迎光临我的菜园子:
http://spaces.msn.com/members/headfaint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060525/097652de/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月25日 星期四 16:15

肯定来过 rocker.yuan at gmail.com
Thu May 25 16:15:42 HKT 2006

能看到的,不过我不懂django。

k = str( k )这一行错在哪儿呢?我刚才以为自己明白了,回头测试一下,问题依然存在其实。麻烦您给解释一下吧

在06-5-25,头太晕 <super852 at gmail.com> 写道:
>
> 我刚才发的那个问题,你能看到吗?我怕发送没成功.
>
> 在06-5-25,头太晕 <super852 at gmail.com> 写道:
>
> > k = str( k )
> > 这一行错了吧?
> >
> > 在06-5-25,肯定来过 < rocker.yuan at gmail.com> 写道:
> >
> > > 对不起,自己弄明白了!耽误大家时间
> >
> > 在06-5-25,肯定来过 < rocker.yuan at gmail.com> 写道:
> >
> > > >>> str = time.localtime( 1148007668 )
> > > >>> str
> > > (2006, 5, 19, 11, 1, 8, 4, 139, 0)
> > > >>> for k in str:
> > > ...     k = str( k )
> > > ...     print k
> > > ...
> > > Traceback (most recent call last):
> > >   File "", line 2, in ?
> > > TypeError: 'time.struct_time' object is not callable
> > >
> > > --
> > > 因为你,我才在这沙漠中独步而行…
> > > http://spaces.msn.com/shoujing/
> > >
> >
> >
> >
> > --
> > 因为你,我才在这沙漠中独步而行…
> > http://spaces.msn.com/shoujing/
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> >
> >
> >
> > --
> > 阿弥陀佛 晕哉 晕哉
> > --------
> > 欢迎光临我的菜园子:
> > http://spaces.msn.com/members/headfaint
> >
>
>
>
> --
> 阿弥陀佛 晕哉 晕哉
> --------
> 欢迎光临我的菜园子:
> http://spaces.msn.com/members/headfaint
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>


-- 
因为你,我才在这沙漠中独步而行…
http://spaces.msn.com/shoujing/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060525/3f57c1e1/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月25日 星期四 16:20

头太晕 super852 at gmail.com
Thu May 25 16:20:10 HKT 2006

>>> import time
>>> s=time.localtime(1148007668)
>>> s
(2006, 5, 19, 11, 1, 8, 4, 139, 0)
>>> for k in s:
    print k


2006
5
19
11
1
8
4
139
0
>>>


(2006, 5, 19, 11, 1, 8, 4, 139, 0) 是一个序列

在06-5-25,肯定来过 <rocker.yuan at gmail.com> 写道:
>
> 能看到的,不过我不懂django。
>
> k = str( k )这一行错在哪儿呢?我刚才以为自己明白了,回头测试一下,问题依然存在其实。麻烦您给解释一下吧
>
>
> 在06-5-25,头太晕 <super852 at gmail.com> 写道:
> >
> > 我刚才发的那个问题,你能看到吗?我怕发送没成功.
> >
> > 在06-5-25,头太晕 < super852 at gmail.com> 写道:
> >
> > > k = str( k )
> > > 这一行错了吧?
> > >
> > > 在06-5-25,肯定来过 < rocker.yuan at gmail.com> 写道:
> > >
> > > > 对不起,自己弄明白了!耽误大家时间
> > >
> > > 在06-5-25,肯定来过 < rocker.yuan at gmail.com> 写道:
> > >
> > > > >>> str = time.localtime( 1148007668 )
> > > > >>> str
> > > > (2006, 5, 19, 11, 1, 8, 4, 139, 0)
> > > > >>> for k in str:
> > > > ...     k = str( k )
> > > > ...     print k
> > > > ...
> > > > Traceback (most recent call last):
> > > >   File "", line 2, in ?
> > > > TypeError: 'time.struct_time' object is not callable
> > > >
> > > > --
> > > > 因为你,我才在这沙漠中独步而行…
> > > > http://spaces.msn.com/shoujing/
> > > >
> > >
> > >
> > >
> > > --
> > > 因为你,我才在这沙漠中独步而行…
> > > http://spaces.msn.com/shoujing/
> > >
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese at lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > > python-chinese-request at lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> > >
> > >
> > >
> > > --
> > > 阿弥陀佛 晕哉 晕哉
> > > --------
> > > 欢迎光临我的菜园子:
> > > http://spaces.msn.com/members/headfaint
> > >
> >
> >
> >
> > --
> > 阿弥陀佛 晕哉 晕哉
> > --------
> > 欢迎光临我的菜园子:
> > http://spaces.msn.com/members/headfaint
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> >
>
>
> --
> 因为你,我才在这沙漠中独步而行…
> http://spaces.msn.com/shoujing/
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>


-- 
阿弥陀佛 晕哉 晕哉
--------
欢迎光临我的菜园子:
http://spaces.msn.com/members/headfaint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060525/abed5ace/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月25日 星期四 16:30

马踏飞燕 honeyday.mj at gmail.com
Thu May 25 16:30:56 HKT 2006

str是个元组,不是字典。
要引用里面的元素的话,应该使用下标的形式。

str(k)相当于把str当成函数来调用了,当然会提示not callable。

在 06-5-25,肯定来过<rocker.yuan at gmail.com> 写道:
> 能看到的,不过我不懂django。
>
> k = str( k )这一行错在哪儿呢?我刚才以为自己明白了,回头测试一下,问题依然存在其实。麻烦您给解释一下吧
>
>
> 在06-5-25,头太晕 <super852 at gmail.com> 写道:
> >
> > 我刚才发的那个问题,你能看到吗?我怕发送没成功.
> >
> >
> > 在06-5-25,头太晕 < super852 at gmail.com> 写道:
> >
> > >
> > > k = str( k )
> > > 这一行错了吧?
> > >
> > >
> > >
> > > 在06-5-25,肯定来过 < rocker.yuan at gmail.com> 写道:
> > >
> > > >
> > >
> > >
> > > 对不起,自己弄明白了!耽误大家时间
> > >
> > >
> > > 在06-5-25,肯定来过 < rocker.yuan at gmail.com> 写道:
> > >
> > > >
> > > > >>> str = time.localtime( 1148007668 )
> > > > >>> str
> > > > (2006, 5, 19, 11, 1, 8, 4, 139, 0)
> > > > >>> for k in str:
> > > > ...     k = str( k )
> > > > ...     print k
> > > > ...
> > > > Traceback (most recent call last):
> > > >   File "", line 2, in ?
> > > > TypeError: 'time.struct_time' object is not callable
> > > >
> > > >
> > > > --
> > > > 因为你,我才在这沙漠中独步而行…
> > > > http://spaces.msn.com/shoujing/
> > > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > 因为你,我才在这沙漠中独步而行…
> > > http://spaces.msn.com/shoujing/
> > >
> > >
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese at lists.python.cn
> > > Subscribe: send subscribe to
> python-chinese-request at lists.python.cn
> > > Unsubscribe: send unsubscribe to
> python-chinese-request at lists.python.cn
> > > Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
> > >
> > >
> > >
> > >
> > > --
> > > 阿弥陀佛 晕哉 晕哉
> > > --------
> > > 欢迎光临我的菜园子:
> > > http://spaces.msn.com/members/headfaint
> >
> >
> >
> >
> >
> > --
> > 阿弥陀佛 晕哉 晕哉
> > --------
> > 欢迎光临我的菜园子:
> > http://spaces.msn.com/members/headfaint
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to
> python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to
> python-chinese-request at lists.python.cn
> > Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
> >
> >
>
>
>
> --
> 因为你,我才在这沙漠中独步而行…
> http://spaces.msn.com/shoujing/
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to
> python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to
> python-chinese-request at lists.python.cn
> Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
>
>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月25日 星期四 18:55

lubiao lubiao.py at gmail.com
Thu May 25 18:55:31 HKT 2006

>>> str(1000)
'1000'
>>> str = 100
>>> str (100)
Traceback (most recent call last):
  File "", line 1, in ?
TypeError: 'int' object is not callable
>>>

变量名
不要用 built-in 函数名


>
> k = str( k )这一行错在哪儿呢?我刚才以为自己明白了,回头测试一下,问题依然存在其实。麻烦您给解释一下吧
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060525/5cef8e38/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年05月25日 星期四 23:12

hal sunchaojun at gmail.com
Thu May 25 23:12:03 HKT 2006

把变量str换个名字,它覆盖了内部函数str
mystr = time.localtime( 1148007668 )

在 06-5-25,肯定来过<rocker.yuan at gmail.com> 写道:
> >>> str = time.localtime( 1148007668 )
>  >>> str
>  (2006, 5, 19, 11, 1, 8, 4, 139, 0)
>  >>> for k in str:
>  ...     k = str( k )
>  ...     print k
>  ...
>  Traceback (most recent call last):
>    File "", line 2, in ?
>  TypeError: 'time.struct_time' object is not callable
>
> --
> 因为你,我才在这沙漠中独步而行…
> http://spaces.msn.com/shoujing/
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to
> python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to
> python-chinese-request at lists.python.cn
> Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
>
>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号