Py.Cafe

kecnry/

phoebe

install phoebe within py.cafe

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import solara
from astropy import units as u

clicks = solara.reactive(0)


@solara.component
def Page():
    color = "green"
    if clicks.value >= 5:
        color = "red"

    def increment():
        clicks.value += 1
        print("clicks", clicks)  # noqa

    solara.Button(label=f"Clicked: {(clicks*u.m).to_value(u.cm)}", on_click=increment, color=color)