Created
February 16, 2018 22:59
-
-
Save Fhernd/0ed5535d31ca21465636f5b833cc98cf to your computer and use it in GitHub Desktop.
Comunicación entre procesos por medio de los pipes en Python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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