On Wednesday, April 4, 2012 12:16:46 PM UTC-4, Ramos wrote:
>
> i changed to another function "reload", so i can open my index in the
> browser
>
> executing python web2py.py -S myapp/default/reload -M -A aaaa
>
> i get the error
> reload() takes exactly 1 argument (0 given)
>
What exactly are you trying to do? I think the -A option only works if you
are running a script file via the -R option -- it doesn't pass arguments to
a controller function run with the -S option.
python web2py.py -S myapp/default/reload -M
is intended to execute the reload function in a Python shell. If you want
to start and stay in a Python shell in the environment of your controller,
you can do:
python web2py.py -S myapp/default -M
and then at the Python shell command line you could do:
>>> reload(arg1='myarg')
or if reload() is an action (i.e., it doesn't take any arguments):
>>> request.args.append('myarg')
>>> reload()
and then the reload() function can access 'myarg' via request.args(0).
Anthony