I think you might mean this:
# access count using a bookie or helper function
# (code from G-Do)
def bookie(func):
"""helper function"""
func.count += 1
def f3():
bookie(f3)
# your code goes here
f3.count = 0
for k in range(10):
f3()
print "Function f3() has been accessed", f3.count,"times"
"""
my output -->
Function f3() has been accessed 10 times
"""
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
Offline 5,792 posts
since Oct 2004