also [1]:

...
python web2py.py -S app -M -R applications/app/private/myscript.py -A a b c

where -S app tells web2py to run "myscript.py" as "app", -M tells
web2py to execute models, and -A a b c passes optional command line
arguments sys.argv=['applications/app/private/myscript.py','a','b','c']
to "myscript.py".
...

I have used this method for complex data migrations.

[1] 
http://web2py.com/books/default/chapter/29/04/the-core#Running-tasks-in-the-background

2016-02-10 18:42 GMT-05:00, Dave S <snidely....@gmail.com>:
> On Wednesday, February 10, 2016 at 2:01:52 PM UTC-8, snehalash...@gmail.com
>
> wrote:
>>
>> can we write the python script inweb2py
>>
>
> There are 2 answers to this.  Web2Py depends on a Python installation.  (In
>
> Windows, it's own copy is packaged with Web2py).  You can run ordinary
> Python scripts in that Python enviornment.  But also, Web2Py provides an
> "application-aware" shell enviornment  for running scripts, which can also
> run ordinary Python scripts or it can be used to run scripts that know
> about your application's models and modules.
>
> For a more complete description of this, Chapters 1 and 3 of the book are
> good places to start; Chapter 2 provides a quick introduction to Python.
> <URL:http://web2py.com/books/default/chapter/29/01/introduction>
>
> /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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Yoel Benítez Fonseca
http://redevil.cubava.cu/
$ python -c "import this"

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to