yyyyyyyyyyyyyyyyyyyy

博客园 首页 新随笔 联系 订阅 管理

print "I have a proble! And here is at Line: %s"%sys._getframe().f_lineno

 

PDB,哈哈http://docs.python.org/library/pdb.html

 

import fileinput

fileinput.filename()

 

 

import srcinfo

 

print ('warning: %s: %d: %s' %(srcinfo.file(), srcinfo.line(), x))

 

绝对路径 os.path.realpath(__file__)

 

文件名:

#!/usr/bin/env python
print __file__

 

posted on 2015-08-16 01:55  xxxxxxxx1x2xxxxxxx  阅读(450)  评论(0编辑  收藏  举报