python sys模块

1. 获得当前代码所在的行

import sys
print "here is:", __file__, ":", sys._getframe().f_lineno
原文地址:https://www.cnblogs.com/kaituorensheng/p/4477532.html