On 03/06/2014 06:00 PM, Jignesh Sutar wrote:
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()

The simple way is to have a param telling about the caller. (But _probably_ you don't _really_ need that, it is instead an artifact of unproper design.)

denis
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to