# Jupyter Lab extensions python-javascript communication

**URL:** <https://discourse.jupyter.org/t/jupyter-lab-extensions-python-javascript-communication/15060>\
**Category:** extensions\
**Tags:** jupyterlab, how-to, help-wanted\
**Created:** [July 23, 2022, 11:26am UTC](https://discourse.jupyter.org/t/jupyter-lab-extensions-python-javascript-communication/15060 "2022-07-23T11:26:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smejak](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/smejak/32/7586_2.png) [@smejak](https://discourse.jupyter.org/u/smejak)\
**Post date:** [July 23, 2022, 11:26am UTC](https://discourse.jupyter.org/t/jupyter-lab-extensions-python-javascript-communication/15060/1 "2022-07-23T11:26:16Z")

</div>

Hi everyone 👋

I am building a Jupyter Lab extension that adds extra commands to the main menu. The extension is supposed to create a popup prompt for the user to enter a value which is then passed as a variable in a javascript function. I am using a js library that also has a python version which I have found to be much easier to work with, so I was wondering whether it’s possible to pass the user variable from the extension code to a python script that would then be executed instead of the js one.

I haven’t yet found many resources that deal with this kind of python-javascript communication apart from [ipylab](https://github.com/jtpio/ipylab) but that deals with the python → javascript execution whereas in this case the execution is the other way around.

I appreciate any suggestions!

---

<div class="post-metadata">

**Author:** ![adpatter](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/adpatter/32/21229_2.png) [@adpatter](https://discourse.jupyter.org/u/adpatter)\
**Post date:** [July 26, 2022, 10:57pm UTC](https://discourse.jupyter.org/t/jupyter-lab-extensions-python-javascript-communication/15060/2 "2022-07-26T22:57:43Z")

</div>

A JupyterLab extension with a server extension component might be what you are looking for. [extension-examples/server-extension at master · jupyterlab/extension-examples · GitHub](https://github.com/jupyterlab/extension-examples/tree/master/server-extension)
