Interactive Processing of print

For example, I have a python program that does

print “hello”
print “world”

and i want to print this on ruby

“hello foo”
(wait 10 seconds)
“world foo”

I tried :

IO.popen(“python”) do |p|
p.each do |line|
puts line + “foo”

and it does everything except , it waits the 10 seconds before it
begins processing so it is not interactive

i mainly want to process a realtime running application (from any
programming language) that prints many statements which I would like to
intercept and print to the site

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs