[Tutor] How to determine which function code is being called from

Jignesh Sutar jsutar at gmail.com
Thu Mar 6 18:00:46 CET 2014


Hi I'm trying to exclude a certain line of code if the function is called
by another function, see illustration below:


def funcA():
    print "running from funcA" # print only if running from funcA
    print "running from funcA or funcB" #print when running from either
function
    print "running from funcB" # print only when running from funcB

def funcB():
    funcA()

funcB()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140306/42664523/attachment.html>


More information about the Tutor mailing list