Thank you so much!!

----------------------------------------------------------------------------------------------------------------------------------


Michael Natkin
CTO
http://ChefSteps.com <http://chefsteps.com/>


On Tue, Dec 17, 2013 at 3:46 PM, Łukasz Mach <[email protected]> wrote:

>
> W dniu 17.12.2013 19:39, Michael Natkin pisze:
>
>  Hey Maho - thanks a million, that was exactly the problem. If anyone has
>> time, a followup question. The thing I'm actually trying to translate from
>> python to javascript is essentially a headless mathematical calculation. In
>> simplest form, suppose my python program was
>>
>> def superComplicatedCalculation(a, b):
>>     return a+b
>>
>> my whole UI is already built in JS so I don't want to use pyjs widgets at
>> all. Could anyone point me in the direction of whatever wrapping and
>> compilation steps I'd need to do to be able to call
>> superComplicatedCalculation from JS?
>>
>
> Yep, it's very easy.
>
> def fn():
>     return "something"
>
> if __name__ == '__main__':
>     from __pyjamas__ import wnd
>
>     wnd().fn = fn
>
> And in your javascript code you run fn() or window.fn() ( I don't remember)
>
>
> --
>
> --- You received this message because you are subscribed to a topic in the
> Google Groups "Pyjs.org Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/pyjs-users/aBXdpuB8rWE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Pyjs.org 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/groups/opt_out.

Reply via email to