I'm writing a script using Flet and I need to write a script to restart the app, but I don't know how to implement it.
Here's the code:
def theme_changed(e):
print(data["theme"])
data["theme"] = str(theme_dd.value)
print(data["theme"])
def close_app(e):
page.banner.open = False
#Here I need the code
def restar_late(e):
page.banner.open = False
page.update()
page.banner = ft.Banner(leading=ft.Icon(ft.icons.SETTINGS,color=ft.colors.RED_100,size=40),content=
ft.Text("Please restart the application\nto apply the changes",font_family=font),actions=[
ft.ElevatedButton("Restart Now",style=buttonsStyle,on_click=close_app),
ft.ElevatedButton("Restart Late",style=buttonsStyle,on_click=restar_late)
],open=True)
page.update()