Launch dash app from main program

Hello everybody,
I am a newbie using python and dash and I am making a python script to collect data from a production line and I would like to show it to users through an app.

I can’t run the dash app from the main program, something like this:


def main():
    global opc_enabled
    global auto_start
    global plc_ip

    task_thread ('OPC')
    task_thread ('runtime')
    task_thread ('webapp')
    ...
    myfun1 ()
    myfun2 ()
    ...
    ...
    *app.run_server(debug=True)*

    return 0


if __name__ == '__main__':
    main()

Is this possible to do?

Thank you