__FUNCTION__ and __LINE__ in Python


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. def __line__ ():
  2. caller = inspect.stack()[1]
  3. return int (caller[2])
  4.  
  5. def __function__ ():
  6. caller = inspect.stack()[1]
  7. return caller[3]

URL: http://juliobiason.net/2006/06/16/255306/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.