Global variables

Hello,
After developing an application in R/Shiny , I am now trying to do the same with Python.
In R I finally understood that the best for global variables modified by reactive functions was to declare them as reactiveVal in the server function. Here is the way I use to proceed:

server <- function (input, output, session) {
   val <- reactiveVal(...)

   observeEvent(...., {
      myVal <- val()
      //// operations on myVal
      val(myVal)
   })
}

Is there an equivalent practice in Shiny for Python ?

Just a comment:

If you define a variable in the server function it is not global, it is per (browser) session.

You may define reactiveVals in global.R to share them across sessions.

Please check: