From: Jonathan Nielsen Date: 2010-04-24T11:48:59+09:00 Subject: Re: Ruby to Python communication On Fri, Apr 23, 2010 at 7:06 PM, Philip Rhoades wrote: > 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: > >        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. 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 Nielsen