| | |
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
Views: 612 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Python
anti approximation array avogadro basic beginner builtin cipher clear code color converter countpasswordentry cturtle curved def dictionary drive dynamic examples excel file float format frange ftp function gui homework import input java lapse library line lines linux list lists loop mouse multiple mysqldb mysqlquery newb number numbers output parsing path port prime program programming projects py2exe pygame pymailer pyqt python random raw_input recursion recursive redirect script scrolledtext server singleton sqlite ssh stamp stderr string strings subprocess sum syntax table terminal text textarea thread threading time tkinter tlapse tuple tutorial twoup ubuntu unicode urllib urllib2 variable web-scrape wikipedia windows word wxpython






