标签:
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__
标签:
原文地址:http://www.cnblogs.com/x113/p/4733515.html