Python论坛  - 讨论区

标题:[python-chinese] __line__ and __name__

2006年05月05日 星期五 22:13

cry zyqmail at tom.com
Fri May 5 22:13:13 HKT 2006

tocer,您好!

谢谢tocer。
自然是有用,哈哈。

在 2006-05-05 17:48:00 您写道:
>打印行号的问题可以看看 traceback 模块,可能有帮助
>
>打印名字的问题,没看出来有什么必要,你的例子中不是已经知道是什么变量么,
>还有名字干什么?
>
>cry 写道:
>> tocer,您好!
>>
>> 比如(说明意思,肯定是执行不了的):
>> print __LINE__ # 打印当前行的行号
>>
>> a=1
>>
>> print a.__NAME__
>_______________________________________________
>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

                    致
礼!

            cry
            zyqmail at tom.com



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

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

    你的回复:

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

    Zeuux © 2025

    京ICP备05028076号