I’m writting a python script that retrive EUR/USD data prices and display them with plotly on my web browser. Every minutes a new price is received, so I use the add_traces( ) function to update my figure and figure.show( ) to display the result.
But the show function open a new tab every time.
How can I use only 1 tab and update my data on this single tab ?
Isn’t callback a Dash feature? I would prefer to not use Dash if possible because I can’t use Dash in multi-threading. Can you give me a sample code please ?
Debug mode: on
Exception in thread Thread-7 (run_server):
Traceback (most recent call last):
File “C:\Users\tessa\AppData\Local\Programs\Python\Python310\lib\threading.py”, line 1009, in _bootstrap_inner
self.run()
File “C:\Users\tessa\AppData\Local\Programs\Python\Python310\lib\threading.py”, line 946, in run
self._target(*self._args, **self._kwargs)
File “C:\Users\tessa\envs_python\deepQlearn\lib\site-packages\dash\dash.py”, line 2132, in run_server
self.run(*args, **kwargs)
File “C:\Users\tessa\envs_python\deepQlearn\lib\site-packages\dash\dash.py”, line 1979, in run
self.server.run(host=host, port=port, debug=debug, **flask_run_options)
File “C:\Users\tessa\envs_python\deepQlearn\lib\site-packages\flask\app.py”, line 1188, in run
run_simple(t.cast(str, host), port, self, **options)
File “C:\Users\tessa\envs_python\deepQlearn\lib\site-packages\werkzeug\serving.py”, line 1090, in run_simple
run_with_reloader(
File “C:\Users\tessa\envs_python\deepQlearn\lib\site-packages\werkzeug_reloader.py”, line 427, in run_with_reloader
signal.signal(signal.SIGTERM, lambda *args: sys.exit(0))
File “C:\Users\tessa\AppData\Local\Programs\Python\Python310\lib\signal.py”, line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread of the main interpreter
I think it’s because Dash is not compatible with multi threading