I was able to print the value of the dropdown using a callback. Is there any way to put this value in a python variable?
I want to use it (turkey) in an API endpoint.
If you have the value in a callback, then it already is a Python variable. I assume you did something similar to this?
@app.callback(
Output('my-output', 'value')
Inputs[('my-input', 'value')])
def callback_func(dropdown_value):
print(dropdown_value)
You can use dropdown_value
here in that function just like any other Python variable. It is limited to the scope of the function, but you could do things to make it accessible elsewhere, just like with other variables in functions. You could write it to a file, add it to a list or dict from some other context, and so on.