WebServer and running code parallel
I have implemented a tiny WebServer in Python.
This code fragment is receiving any request to the m5stack device.
conn, addr = s.accept()
request = conn.recv(1024)
request = str(request)
Now I have the problem, that the code "conn.recv()" ist waiting for request, but no other code is executing in the meantime.
Does anyone know a trick to run code in "parallel", while conn.recv() is waiting for any request?
Thanks very much for help :-)
I've got it.
I can start new threads with:
import _thread as th
Cool stuff :-)