| | |
HElper function
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
I think you might mean this:
python Syntax (Toggle Plain Text)
# 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 """
May 'the Google' be with you!
Ah, I didn't know that myself either. Is there more of a general definition of it? I get what the example does, but I'm just curious about the sort of extent/functions that this term can be used to/for.
"Two good old boys in a fire-apple red convertible. Stoned. Ripped. Twisted. Good people."
- Hunter S. Thompson
my photography
- Hunter S. Thompson
my photography
![]() |
Similar Threads
- Family Tree scheme function (Legacy and Other Languages)
- Need direction on how start this program (C++)
- Need direction on how start this programm (C++)
- Trojan Horse,Download.Trojan not repaired by Norton;network doesn't function (Viruses, Spyware and other Nasties)
- accessing private data members (C++)
- 35 processes, need to trim the fat (Viruses, Spyware and other Nasties)
- struct type redefinition (C++)
Other Threads in the Python Forum
- Previous Thread: What's wrong with this Boa code ?
- Next Thread: Problems with Vista and wxPython
| Thread Tools | Search this Thread |
Tag cloud for Python
accessdenied apache application argv beginner book change code color dictionary dynamic edit editing enter examples excel file filename float format ftp function gui homework import inches input java keyboard lapse library line lines linux list lists loop microphone mouse movingimageswithpygame mysql newb number numbers numeric output parameters parsing path phonebook port prime print program programming projects py2exe pygame pyopengl pyqt python random recursion recursive redirect remote reverse scrolledtext server session simple smtp software sprite ssh statictext string strings syntax table tennis terminal text thread threading time tkinter tlapse trick tuple tutorial ubuntu unicode unit urllib urllib2 variable windows wordgame wxpython






