From: Roger Pack Date: 2009-06-24T03:38:19+09:00 Subject: Re: Capturing System Call Return Values? > Where I was expecting to see test = True. The return value of the > system call is not being capture when I call a python script, yet IS > when a 'system call' is made. I think the confusion comes from this: >> system("python test.py") Testing! my script 2nd line => true that last true means "the command returned a value of 0" and is a ruby true if you want the output *and* its success value then you'll need to use >> %x[python test.py] => "Testing! my script \n2nd line\nTrue\n" >> $?.exitstatus == 0 => true There's your true. If you want to get the last thing the python script outputs then [pretend last line is "print returnValue()"] it'll be something like %x[python test.py].split("\n")[-1] Maybe one of those will help you. Or use Rye which appears to do that in a class oriented way. -=r -- Posted via http://www.ruby-forum.com/.