Panel in PyScript Example

If you have not noticed you can now actually run Panel apps entirely in the browser using PyScript. I.e. you don’t need to deploy to a server. You can just email your Panel app as a file, put it on Github pages or similar.

The below is a simple example. You can find the official examples at PyScript demo.

      <title>Panel Example</title>
      <meta charset="iso-8859-1">
      <link rel="icon" type="image/x-icon" href="./favicon.png">
      <script type="text/javascript" src=""></script>
      <script type="text/javascript" src=""></script>
      <script type="text/javascript" src=""></script>
      <script type="text/javascript" src=""></script>
      <link rel="stylesheet" href="" />
      <script defer src=""></script>
        table { width: 500px;}
        h1 {font-size: 30px}
      - bokeh
      - numpy
      - panel==0.13.1
      <div id="simple_app"></div>
        import panel as pn
        import calendar

        month = pn.widgets.IntSlider(start=1, end=12, name='Month')
        def callback(new):
            return c.formatmonth(2022,new)
            "# Panel PyScript Calendar Example", 
            pn.bind(callback, month),

Looks awesome!
do you know what the limitations are as of now / bottlenecks?

e.g. can we bring tabulator with pandas or perspective widget as seamlessly?


1 Like

The Panel things I’ve tried seems to work.

I think the bottlenecks are more on the PyScript/ Pyodide side

  • Slow to load
  • More difficult to load data. For example must use pd.read_csv(pyodide.open_url(....)).
  • Development cycle slower because pyscript cannot autoreload fast and because error messages not so mature.

The Panel Kmeans example is one of the official PyScript examples and uses the Tabulator widget :wink:

PyScript is a very recent project and far from maturity, and I’d say and so is the whole story of Python in the browser, which is why things like loading data as mentioned by Marc are not yet super smooth. Is this going to improve? I’d bet so!