Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2009-02-02 04:05:35
Size: 1004
Editor: ZoomQuiet
Comment:
Revision 3 as of 2009-11-28 15:01:22
Size: 937
Editor: Elias
Comment: 删除对PageComment2组件的引用
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
= 自省: 前执行行数 = = 自省: 前执行行数 =
Line 44: Line 44:
||<^>[[PageComment2]]||<^>[:/PageCommentData:PageCommentData]''||

TableOfContents

Include(ZPyUGnav)

自省: 当前执行行数

题面

samson <[email protected]>
reply-to        [email protected]
to      python-cn`CPyUG`华蟒用户组 <[email protected]>
date    Sun, Feb 1, 2009 at 10:45
subject [CPyUG:77839] 怎样在程序中动态获得当前所执行的行号

smallfish:traceback()

smallfish <[email protected]>
reply-to        [email protected]
to      [email protected]
date    Sun, Feb 1, 2009 at 10:48

试试看

   1 import traceback
   2 print traceback.extract_stack()[0][1]

AlbertLee

http://blog.csdn.net/albertlee/archive/2004/11/10/175818.aspx


反馈

创建 by -- ZoomQuiet [DateTime(2009-02-02T04:05:33Z)]

MiscItems/2009-02-02 (last edited 2009-12-25 07:14:54 by localhost)