Function to execute only once

Lasse Vågsæther Karlsen lasse at vkarlsen.no
Sun Oct 16 19:33:45 CEST 2005


Bengt Richter wrote:
<snip>
>  >>> tmp = 0
>  >>> def execute():
>  ...     global tmp, execute
>  ...     tmp = cellvar = tmp + 1
>  ...     def execute():
>  ...         return cellvar
>  ...     return tmp
<snip>

On man did this put my head into a spin :P

-- 
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:lasse at vkarlsen.no
PGP KeyID: 0x2A42A1C2



More information about the Python-list mailing list