multithreading - retrieve data from a thread in python -


I have a python that receives the OSS packet ... I have to get data from the OSC in my main function. How can the thread get data from a thread? Here's the code to demonstrate my problem:

Try the YIH class, but so far "data is not set

  import osc import threading import atexit # ------ OSC server ------------------------------------- # get_address = '127.0 .0.1 ', 7402 # OSSC servers are three different types of servers. S = OSC.ThreadingOSCServer (receive_address) # This receives a' default 'handler (for mismatched messages) s.addDefaultHandlers () class: def print_handler (ADR, tags, data, source ): If addr == '/ data': self.data = data.pop (0) s.addMsgHandler ("/ data", print_handler) returns data def main (manually): # OSCServer #Main start function ... I want to get 'data' from the OSS thread, print here, "OSCsRark start" st = threading.Thread (target = s.serve_forever) st.start () reception = received () reception.main () plouf = data Thanksgiving Print Plouf  

Thanks in advance

standard library Use one of, or use global variables.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -