Hello all, I have been setting up some communication between applications using websockets in python. The module is websocket-client.
The comms is great, the messages are sent and received which is what I need I have hit a snag though. I have a function inside my script that needs to be called from Maya whenever we need it to. When the websocket is set up I call run_forever to keep the socket open for future comms. The problem is I cannot jump out of the run_forever loop so that the executeExternal function can be called. I have read up on Queues but am stumped with how to use properly or if I should in this case? The idea is that I will eventually call the main function for the websocket inside a thread from Maya like so: # Inside user setup or wherever in the code base import ws import threading ws = threading.Thread(target=ws.main) ws.start() # Call execute external function later from wherever in the code base *Code is below:* https://gist.github.com/ben-hearn-sb/6f3b283e62e8691119e3 Cheers, Ben -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b3d2be9c-5374-4ec2-9924-c2576dc47dc1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
