Prev: [ANN] ad_agency version 0.1.2 has been released
Next: ncurses-ruby install failing on OS X Snow Leopard
From: Philip Rhoades on 23 Apr 2010 21:06 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. _______________________________________________ develop mailing list develop(a)pculture.org http://mailman.pculture.org/listinfo/develop
From: Jonathan Nielsen on 23 Apr 2010 22:48
On Fri, Apr 23, 2010 at 7:06 PM, Philip Rhoades <phil(a)pricom.com.au> 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 |