This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Root's .gitignore hides doc/extension/demo.py (#452)
Co-authored-by: Fabien Lelaquais <[email protected]>
- Loading branch information
1 parent
bc333ce
commit dbe8175
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!demo.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from taipy.gui import Gui | ||
from my_custom_lib import MyLibrary | ||
import random | ||
import string | ||
|
||
value = "a" | ||
|
||
page = """ | ||
# A custom element | ||
*My custom label:* <|{value}|my_custom.label|> | ||
<|Add a character|button|> | ||
""" | ||
|
||
def on_action(state): | ||
state.value = state.value + random.choice(string.ascii_letters) | ||
|
||
gui = Gui(page) | ||
gui.add_library(MyLibrary()) | ||
gui.run() |