0

I'm trying to get started with Dash but even the hello World example doesn't show up on two different laptops under Windows 11 started from within Visual Studio 2022

"my" code

# https://dash.plotly.com/tutorial
from dash import Dash, html

app = Dash(__name__)

app.layout = html.Div([
    html.Div(children='Hello World')
])

if __name__ == '__main__':
    app.run()

If I 'Start without debugging' the following appears in the command window app started without debugging

If I 'Start with debugging' I get enter image description here

and if I start with app.run(debug=True) I don't get any further than enter image description here

Examples I found that should display a figure in a browser but those do not work either.

I also tried

if __name__ == '__main__':
    app.run(host="127.0.0.1", port=5000)

What am I missing that makes that I don't see any output?

SoftwareTester
  • 1,048
  • 1
  • 10
  • 25

1 Answers1

1

Forgive me if I am misunderstanding, but it sounds like you are waiting for some "output" to be printed to the terminal or opened automatically where you can see the contents of your app. To view your Dash app, use the link that it says it's running on in the terminal, which in your case is http://127.0.0.1:8050/ (port 8050 on your local machine).

sky
  • 46
  • 5
  • Thanks, this helped. So it means I have to open the page in the browser myself. That is (of course) not what I want so I have to find out how to open that automatically. – SoftwareTester Aug 13 '23 at 07:08
  • I found it, see https://stackoverflow.com/questions/71697716/how-to-automatically-open-a-website-when-launching-the-dash I didn't find that yesterday – SoftwareTester Aug 13 '23 at 07:13