I am new in Python and I want to get the value from a thread. I call the function logica in a thread and that function returns a value I want to know how can I get the value songs because I will use it later in an iter. Comand is a string. I am using the library threading
def logica_thread ( comand):
threading.Thread(target= logica ,args = (comand,), daemon = True).start()
def logica(comando):
request = requests.get('http://127.0.0.1:5000/' + comand)
time.sleep(5)
songs = request.json()['data']
return songs