As is asked in this post, I can use Python's subprocess.Popen() function to print out the value from running ruby's code.
import subprocess
import sys
cmd = ["ruby", "/Users/smcho/Desktop/testit.rb"]
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
for line in iter(p.stdout.readline, ''):
print line,
sys.stdout.flush()
p.wait()
How can I do the same thing with C#? How can one print the value what the subprocess prints out?
You need to redirect stdout when spawning the child process; MSDN has a complete example: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput.aspx
(from MSDN):