print('hehe')
echo 'hehe ' . __LINE__; // выведет "hehe 2"
def debug(msg):
import sys
frame = sys._getframe(1)
name = frame.f_code.co_name
line_number = frame.f_lineno
filename = frame.f_code.co_filename
return 'File "%s", line %d, in %s: %s' % (filename, line_number, name, msg)
print(debug('hehe'))
File "/home/sergey/Рабочий стол/Projects/l.py", line 12, in <module>: hehe