Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import panel as pn
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
# Create buttons for the toggleable sidebar
|
| 6 |
button1 = pn.widgets.Button(icon='home', name="Home", icon_size='1.5em', button_type = 'primary', button_style = 'outline', width = 140)
|
|
@@ -115,5 +115,15 @@ template = pn.template.FastListTemplate(
|
|
| 115 |
sidebar_width=150
|
| 116 |
)
|
| 117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
# Run the app
|
| 119 |
template.servable()
|
|
|
|
| 1 |
import panel as pn
|
| 2 |
|
| 3 |
+
|
| 4 |
|
| 5 |
# Create buttons for the toggleable sidebar
|
| 6 |
button1 = pn.widgets.Button(icon='home', name="Home", icon_size='1.5em', button_type = 'primary', button_style = 'outline', width = 140)
|
|
|
|
| 115 |
sidebar_width=150
|
| 116 |
)
|
| 117 |
|
| 118 |
+
|
| 119 |
+
def run_code():
|
| 120 |
+
# Add your desired Python code here
|
| 121 |
+
# For example, let's print "Hello, Panel!" when the button is clicked
|
| 122 |
+
print("Hello, Panel!")
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
# Attach the function to the button's on_click event
|
| 126 |
+
button3.on_click(run_code)
|
| 127 |
+
|
| 128 |
# Run the app
|
| 129 |
template.servable()
|