On Wednesday, June 1, 2016 at 2:16:47 PM UTC-7, Alex Glaros wrote:
>
> what would the syntax be Dave? I don't know how to move a def into another 
> def..
>


Cut, paste, and adjust the indentation.  As the Python docs say, 
"Programmer’s note: Functions are first-class objects. A “def” form 
executed inside a function definition defines a local function that can be 
returned or passed around. Free variables used in the nested function can 
access the local variables of the function containing the def. See section 
Naming and binding for details."  (Sec 7.6 Function Definitions, at
<URL:https://docs.python.org/2/reference/compound_stmts.html#function>

There's a recent example in the group at
<URL:https://groups.google.com/d/msg/web2py/h5vnE56IZrM/MnOZWVhcAwAJ>
(Minor amusing note: the Python function returned in that example... is 
used to generate Javascript)

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to