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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to