Calling JavaScript from Streamlit/Python

Опубликовано: 20 Ноябрь 2022
на канале: Andrej Baranovskij
5,365
42

Streamlit is Python framework, it helps to build UI with low code approach. Code runs on server and there is no functionality, which would allow to inject client side events with JavaScript. Luckily there is a 3rd-party Streamlit component, it allows to make JavaScript calls from server side Python code. Response from such JavaScript call is received within the same Streamlit execution, this makes it possible to use values returned from JavaScript in Python logic. In this example, I show one liner JavaScript call to get UI screen width, to be able to calculate layout structure adjustments in Python, based on the screen size.

Streamlit JavaScript component GitHub:
https://github.com/thunderbug1/stream...

0:00 Introduction
1:02 Streamlit JavaScript Component
1:36 Example
3:30 Code
5:47 Summary

CONNECT:
Subscribe to this YouTube channel
Twitter:   / andrejusb  
LinkedIn:   / andrej-baranovskij  
Medium:   / andrejusb  

#javascript #webdevelopment #python


На этой странице сайта вы можете посмотреть видео онлайн Calling JavaScript from Streamlit/Python длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Andrej Baranovskij 20 Ноябрь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 5,365 раз и оно понравилось 42 зрителям. Приятного просмотра!