Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created February 16, 2018 22:59
Show Gist options
  • Save Fhernd/0ed5535d31ca21465636f5b833cc98cf to your computer and use it in GitHub Desktop.
Save Fhernd/0ed5535d31ca21465636f5b833cc98cf to your computer and use it in GitHub Desktop.
Comunicación entre procesos por medio de los pipes en Python.
import multiprocessing
def enviar_datos(pipe_terminal):
pipe_terminal.send(['Python', '2'])
pipe_terminal.close()
if __name__ == '__main__':
pipe_1, pipe_2 = multiprocessing.Pipe()
proceso = multiprocessing.Process(target=enviar_datos, args=(pipe_2,))
proceso.start()
print(pipe_1.recv())
proceso.join()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment