[web2py] Re: Where to call python code for processing (embedded as JS or in controllers)?

2015-07-09 Thread Phillip
The first processing is the importing of files which is intensive due to 
collecting data on pattern recognition in the files. Similarly, the 
processing intensiveness (on stored files after unpickling them) will be 
high in application due to extrapolation of the collected data. Larger 
files may compound the processing time, and processing large batches of 
data would ideally be an option. Clearly I do not have any web development 
experience, so I don't know whether converting large or multiple scripts to 
javascript could be problematic. So the factors seem to be: how costly GAE 
could be for server processing (where the Python is used in the 
controller), and if the cost is not negligible, whether it would be worth 
attempting to convert and call this code in the browser. Depending on what 
it takes to determine those questions, the Python conversion/embedding 
process may be postponed.

This sort of information has been difficult to come by or get examples on 
so I appreciate your response

-- 
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.


[web2py] Re: Where to call python code for processing (embedded as JS or in controllers)?

2015-07-08 Thread Phillip
Thank you for the responses. The python code does a lot of processing, so I 
need to make sure the application is scalable, and as price-sensitive is 
possible (if my concern is valid). So I'm looking for any way that I can 
allow the client to process the code. So I am trying to figure if possible 
to import the script from the controller to a page somehow.

What I meant by embedding as JS:

If the Python is embedded as converted JavaScript (in the view as 
{{=python}}), would it not be processed by the client? I certainly do not 
assume this to be a viable method. So is there any other way for client 
processing (e.g. loading/accessing the python functions from a view 
(converted to JS or otherwise))?

On Tuesday, July 7, 2015 at 7:01:09 PM UTC-5, Michael Beller wrote:

 Why do you want to prevent the server from doing the python processing?

 I don't know what you mean by instead of embedding as JS

 On Tuesday, July 7, 2015 at 5:40:39 PM UTC-4, Phillip wrote:

 I am having trouble finding anything definitive here. Please help if you 
 have any input, even if short.


 My goal is to prevent the server from doing the python processing. 


 Is this incorrect?: 

 If running the python in the controller function (instead of embedding as 
 JS), the server will do the processing


 Since python functions need to be used in the view for client processing, 
 is there an elegant way to call the python methods in the page? Could you 
 give me an example of a good way to do this with a large script? i.e. 
 returning methods or scripts from the controller, using AJax, etc.

  Am I on the right track?


 Thanks,


 Phillip K



-- 
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.


[web2py] Re: Where to call python code for processing (embedded as JS or in controllers)?

2015-07-08 Thread Anthony
Just to be clear, Python code does not run in the browser -- browsers can 
only run Javascript. If you want to offload processing to the client, they 
you need to convert your code to Javascript. There are a few projects that 
will compile Python code to Javascript, such as Brython.

Anthony

On Wednesday, July 8, 2015 at 8:53:41 AM UTC-4, Phillip wrote:

 Thank you for the responses. The python code does a lot of processing, so 
 I need to make sure the application is scalable, and as price-sensitive is 
 possible (if my concern is valid). So I'm looking for any way that I can 
 allow the client to process the code. So I am trying to figure if possible 
 to import the script from the controller to a page somehow.

 What I meant by embedding as JS:

 If the Python is embedded as converted JavaScript (in the view as 
 {{=python}}), would it not be processed by the client? I certainly do not 
 assume this to be a viable method. So is there any other way for client 
 processing (e.g. loading/accessing the python functions from a view 
 (converted to JS or otherwise))?

 On Tuesday, July 7, 2015 at 7:01:09 PM UTC-5, Michael Beller wrote:

 Why do you want to prevent the server from doing the python processing?

 I don't know what you mean by instead of embedding as JS

 On Tuesday, July 7, 2015 at 5:40:39 PM UTC-4, Phillip wrote:

 I am having trouble finding anything definitive here. Please help if you 
 have any input, even if short.


 My goal is to prevent the server from doing the python processing. 


 Is this incorrect?: 

 If running the python in the controller function (instead of embedding 
 as JS), the server will do the processing


 Since python functions need to be used in the view for client 
 processing, is there an elegant way to call the python methods in the page? 
 Could you give me an example of a good way to do this with a large script? 
 i.e. returning methods or scripts from the controller, using AJax, etc.

  Am I on the right track?


 Thanks,


 Phillip K



-- 
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.


[web2py] Re: Where to call python code for processing (embedded as JS or in controllers)?

2015-07-08 Thread Dave S


On Wednesday, July 8, 2015 at 5:53:41 AM UTC-7, Phillip wrote:

 Thank you for the responses. The python code does a lot of processing, so 
 I need to make sure the application is scalable, and as price-sensitive is 
 possible 


Some of the contributors here run quite large projects with valuable parts 
of the processing on the server (a lot of these are database oriented, or 
handle image processing with database for keeping track of the files).  The 
key to scaling seems to be more in the apache/nginx setup and in using a 
grownup database (sqlite uses large-scale file locking, which can cause 
one request to delay another), rather than in the Python running under 
web2py.  Where Python performance seems to crop up is if your query returns 
a large dataset that you then do further processing on by iterating on each 
row element.

On the other hand, some rendering tasks are quite good candidates for 
client processing, such as spread-sheet like presentation:
URL:http://handsontable.com/

We can't comment intelligently on the performance factors you face without 
knowing more about what sort of processing you intend to do.

/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.


[web2py] Re: Where to call python code for processing (embedded as JS or in controllers)?

2015-07-07 Thread Michael Beller
Why do you want to prevent the server from doing the python processing?

I don't know what you mean by instead of embedding as JS

On Tuesday, July 7, 2015 at 5:40:39 PM UTC-4, Phillip wrote:

 I am having trouble finding anything definitive here. Please help if you 
 have any input, even if short.


 My goal is to prevent the server from doing the python processing. 


 Is this incorrect?: 

 If running the python in the controller function (instead of embedding as 
 JS), the server will do the processing


 Since python functions need to be used in the view for client processing, 
 is there an elegant way to call the python methods in the page? Could you 
 give me an example of a good way to do this with a large script? i.e. 
 returning methods or scripts from the controller, using AJax, etc.

  Am I on the right track?


 Thanks,


 Phillip K


-- 
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.


[web2py] Re: Where to call python code for processing (embedded as JS or in controllers)?

2015-07-07 Thread Anthony
Any Python in your app, whether in a controller or view, will be executed 
on the server, as the browser cannot execute Python. If you want things to 
happen dynamically on the page in the browser without loading a new page, 
then you can use Javascript or make Ajax calls to get new HTML content from 
the server.

Anthony

On Tuesday, July 7, 2015 at 5:40:39 PM UTC-4, Phillip wrote:

 I am having trouble finding anything definitive here. Please help if you 
 have any input, even if short.


 My goal is to prevent the server from doing the python processing. 


 Is this incorrect?: 

 If running the python in the controller function (instead of embedding as 
 JS), the server will do the processing


 Since python functions need to be used in the view for client processing, 
 is there an elegant way to call the python methods in the page? Could you 
 give me an example of a good way to do this with a large script? i.e. 
 returning methods or scripts from the controller, using AJax, etc.

  Am I on the right track?


 Thanks,


 Phillip K


-- 
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.