So, the answer is YES, you can interact with controllers within the shell, I
think web2py could have some helper to wrap that.
< file '/controllers/default.py'>
def sum():
n = request.vars.num
return 1+n
</file>
<shell>
>>> from gluon.shell import exec_environment
>>> request.vars
<Storage {}>
>>> request.vars.num = 4
>>> request.vars
<Storage {'num': 4}>
>>> other =
exec_environment('applications/welcome/controllers/default.py',request=request)
>>> other.soma()
5
</shell>
The same can do with views parsing it using template.py
--
Bruno Rocha
http://about.me/rochacbruno/bio