D
dmatrix00d
For example, I have a python program that does
print "hello"
time.sleep(10)
print "world"
and i want to print this in ruby
"hello foo"
(wait 10 seconds)
"world foo"
I tried :
IO.popen("python example.py") do |p|
p.each do |line|
puts line + "foo"
end
end
and it does everything except , it waits the 10 seconds before it
begins processing so it is not interactive
print "hello"
time.sleep(10)
print "world"
and i want to print this in ruby
"hello foo"
(wait 10 seconds)
"world foo"
I tried :
IO.popen("python example.py") do |p|
p.each do |line|
puts line + "foo"
end
end
and it does everything except , it waits the 10 seconds before it
begins processing so it is not interactive