Is it possible to embed a local webpage into a pyforms webpage?

48 Views Asked by At

I would like to create a simple in-browser GUI for a Python app. One reason I would like to use Pyforms Web for this is that it seems to require little to no HTML/CSS/JS experience.

I would like it to be able to include an embedded local webpage, namely an interactive Plotly dash app, in the local Pyforms webpage. Is this possible using Pyforms?

There is no mention of embedding in the Pyforms documentation, and I have tried searching for the same thing elsewhere.

1

There are 1 best solutions below

1
On
**1. create a Plotly Dash app**

    import dash
    import dash_core_components as dcc
    import dash_html_components as html
    import plotly.express as px
    import pandas as pd

    app = dash.Dash(__name__)

# -make a dataframe
# -make a bar chart with plotly express
--------------------------------------------

**2. create a main Pyforms web app**

    from pyforms_web.web import WebApplication
from pyforms_web.web.middleware import WebMiddleware
import web

    render = web.template.render('templates/')

    #-class app(webapp)
# -def init()
# -def home()
# -def routes()

    if whatever == '__main__':
from Pyforms_web.web import run_app
run_app(app, host='0.0.0.0',port=8080)

------------------------------------------
**3. make some HTML**

    #<!DOCTYPE html>
    <head></head>
    <body>
    <iframe src="http://localhost:8050" width="100%" height="500px"
    frameborder="0"></iframe>
    </body>
-------------------- **4. run 1 and 2 at the same time --> 2 terminals or import multiprocessing**