Advertisement
Fhernd

comunicacion-pipe.py

Feb 16th, 2018
826
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. import multiprocessing
  2.  
  3.  
  4. def enviar_datos(pipe_terminal):
  5.     pipe_terminal.send(['Python', '2'])
  6.     pipe_terminal.close()
  7.    
  8.  
  9. if __name__ == '__main__':
  10.     pipe_1, pipe_2 = multiprocessing.Pipe()
  11.  
  12.     proceso = multiprocessing.Process(target=enviar_datos, args=(pipe_2,))
  13.     proceso.start()
  14.     print(pipe_1.recv())
  15.  
  16.     proceso.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement