Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug mode to tutorial #749

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from taipy import Gui

Gui(page="# Getting started with *Taipy*").run()
Gui(page="# Getting started with *Taipy*").run(debug=True)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
<|{text}|input|>
"""

Gui(page).run()
Gui(page).run(debug=True)
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ def on_change(state, var_name, var_value):
return


Gui(page).run()
Gui(page).run(debug=True)
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ def local_callback(state):
state.dataframe = temp
state.text = ""

Gui(page).run()
Gui(page).run(debug=True)
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ def local_callback(state):
<|{dataframe}|chart|type=bar|x=Text|y[1]=Score Pos|y[2]=Score Neu|y[3]=Score Neg|y[4]=Overall|color[1]=green|color[2]=grey|color[3]=red|type[4]=line|>
"""

Gui(page).run()
Gui(page).run(debug=True)
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ def local_callback(state):
state.dataframe = temp
state.text = ""

Gui(page).run()
Gui(page).run(debug=True)
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ def analyze_file(state):
"text":page_file}


Gui(pages=pages).run()
Gui(pages=pages).run(debug=True)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 16 additions & 8 deletions docs/knowledge_base/tutorials/understanding_gui/step_01/step_01.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,26 @@ browser to open your first Taipy page!
```python
from taipy import Gui

Gui(page="# Getting started with *Taipy*").run() # use_reloader=True
Gui(page="# Getting started with *Taipy*").run(debug=True) # use_reloader=True
```

By default, the page won't refresh on its own after you make a code modification.
The run method accepts different useful parameters:

If you want to alter this behavior, you can set the *use_reloader* parameter of the `run()` method
to True. This will cause the application to automatically reload when you make changes to a file in
your application and save it. It's typically used in development mode.
- _debug_: instructs Taipy to operate in debug mode. This means Taipy will provide a
stack trace of the errors within the application—a valuable feature during
development.

If you wish to run multiple servers concurrently, you can modify the server port number (5000 by
default) in the `run()` method. For example, `Gui(...).run(port=xxxx)`. Other parameters to the
`run()` method can be found
![Debug mode](debug_mode.png){ width=700 style="margin:auto;display:block;border: 4px solid rgb(210,210,210);border-radius:7px" }

- _use_reloader_: By default, the page won't refresh on its own after you make a code
modification. If you want to alter this behavior, you can set the *use_reloader* to
True. The application will automatically reload when you make changes to a file in
your application and save it.

- _port_: If you wish to run multiple servers concurrently, you can modify the server
port number (5000 by default).

Other parameters of the `run()` method can be found
[here](../../../../manuals/gui/configuration.md#configuring-the-gui-instance).


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ My text: <|{text}|>
<|{text}|input|>
"""

Gui(page).run()
Gui(page).run(debug=True)
```

![Visual Elements](result.png){ width=700 style="margin:auto;display:block;border: 4px solid rgb(210,210,210);border-radius:7px" }
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def on_change(state, var_name, var_value):
return


Gui(page).run()
Gui(page).run(debug=True)
```

![Interactive GUI](result.png){ width=700 style="margin:auto;display:block;border: 4px solid rgb(210,210,210);border-radius:7px" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Enter a word:
<|{dataframe}|chart|type=bar|x=Text|y[1]=Score Pos|y[2]=Score Neu|y[3]=Score Neg|y[4]=Overall|color[1]=green|color[2]=grey|color[3]=red|type[4]=line|>
"""

Gui(page).run()
Gui(page).run(debug=True)
```


Expand Down
Loading