Importing Libraries Clarification

32 views
Skip to first unread message

Andy

unread,
Sep 19, 2017, 12:56:36 PM9/19/17
to brython
Hi,

I'd like to ask something that is not clear to me.
 
With Brython, you can import both Python and JS libraries and mix them ? If so, how ? 

Thanks a lot.

Kiko

unread,
Sep 19, 2017, 2:32:25 PM9/19/17
to bry...@googlegroups.com


2017-09-19 18:56 GMT+02:00 Andy <booko...@gmail.com>:
Hi,


Hi
 
I'd like to ask something that is not clear to me.
 
With Brython, you can import both Python and JS libraries and mix them ? If so, how ? 


Brython can import pure python libs and adapted js libs.

The import mechanism is explained here:

If you use 'import whatever' in a brython script (and is not bundled) it will look in several places and it will try to get and parse the whatever code using ajax requests. This doesn't mean you can do something like:

import leaflet

To import the js mapping lib leaflet. To use leaflet or other (not adapted) js libs read below.

Also, you can use pure js libs:
Examples here:

I hope it helps.

 
Thanks a lot.

--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+unsubscribe@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/62112344-2820-4561-b7e1-e5819d50279f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages