# Ruby to Python communication

**URL:** <https://www.ruby-forum.com/t/ruby-to-python-communication/187500>\
**Category:** Ruby\
**Created:** [April 24, 2010, 3:13am UTC](https://www.ruby-forum.com/t/ruby-to-python-communication/187500 "2010-04-24T03:13:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unebaguettesvp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/47e85d/32.png) [@unebaguettesvp](https://www.ruby-forum.com/u/unebaguettesvp)\
**Post date:** [April 24, 2010, 3:13am UTC](https://www.ruby-forum.com/t/ruby-to-python-communication/187500/1 "2010-04-24T03:13:45Z")

</div>

People,

I have written a little Ruby script to restore information on video/  
audio files in a Miro dir structure to a Miro database - the main thing  
I can’t do is to find the feed for particluar directories eg the dir:

This-American-Life

has a feed:

[This American Life](http://feeds.thisamericanlife.org/talpodcast)

but you can’t find out what this will be from the stored videos. One of  
the Miro developers has suggested:

“You could probably write a Python command line script that does what  
you need it to do by using Miro as a library. Then your Ruby script  
could invoke your Python script to get the name of the feed.”

Are there any examples around of Ruby communicating with Python?

Anyone got a simple example that would get me started?

Thanks,

Phil.

---

<div class="post-metadata">

**Author:** ![unebaguettesvp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/47e85d/32.png) [@unebaguettesvp](https://www.ruby-forum.com/u/unebaguettesvp)\
**Post date:** [April 24, 2010, 4:49am UTC](https://www.ruby-forum.com/t/ruby-to-python-communication/187500/2 "2010-04-24T04:49:42Z")

</div>

On Fri, Apr 23, 2010 at 7:06 PM, Philip R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Â Â Â Â [This American Life](http://feeds.thisamericanlife.org/talpodcast)  
> Anyone got a simple example that would get me started?
> 
> Thanks,
> 
> Phil.

You can get the output of a python script (or any command line  
program) from ruby like this:

output = `script.py`  
(or, to specifically call the interpreter)  
output = `python script.py`

This will put anything script.py sends to stdout in the ‘output’  
variable.

-Jonathan N.
