Differences between revisions 3 and 4
Revision 3 as of 2009-11-28 15:01:22
Size: 937
Editor: Elias
Comment: 删除对PageComment2组件的引用
Revision 4 as of 2009-12-25 07:14:54
Size: 937
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
[[TableOfContents]] <<TableOfContents>>
Line 6: Line 6:
[[Include(ZPyUGnav)]] <<Include(ZPyUGnav)>>
Line 43: Line 43:
创建 by -- ZoomQuiet [[[DateTime(2009-02-02T04:05:33Z)]]] 创建 by -- ZoomQuiet [<<DateTime(2009-02-02T04:05:33Z)>>]

自省: 当前执行行数

题面

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 [2009-02-02 04:05:33]

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