Created
July 18, 2014 09:35
-
-
Save marten/917ba962be3a34b20d4f to your computer and use it in GitHub Desktop.
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 subprocess | |
import sys | |
import time | |
proc = subprocess.Popen(['/Users/marten/.rubies/ruby-2.1.1/bin/ruby', '/Users/marten/tmp/python-processes/slave.rb'], | |
stdin=subprocess.PIPE, stdout=sys.stdout) | |
for i in range(5): | |
print "Python preparing to send newline" | |
proc.stdin.write("\n") | |
time.sleep(1) |
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
puts "Ruby started" | |
while line = gets | |
puts "Ruby[#{Process.pid}]: Got a line!" | |
puts "Ruby[#{Process.pid}]: /tmp/foo.png" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment