The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Introducing IoPython: the Io-Python Bridge

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
rodney ramdas

Posts: 66
Nickname: pinupgeek
Registered: Jun, 2006

Rodney Ramdas is a de-enterprised Ruby on Rails developer from the Netherlands.
Introducing IoPython: the Io-Python Bridge Posted: Aug 3, 2006 6:26 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by rodney ramdas.
Original Post: Introducing IoPython: the Io-Python Bridge
Feed Title: pinupgeek.com
Feed URL: http://feeds.feedburner.com/pinupgeek
Feed Description: A personal take on Ruby and Rails
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by rodney ramdas
Latest Posts From pinupgeek.com

Advertisement

Aslak Gronflaten has created an Io-Python bridge i.e you can run Python modules from Io:


# Import a module
sys := Python import("sys")

"Which version of python are we running?" println
sys version println

"System path is returned as a list" println
sys path foreach(p, p println)

"Load the string module" println
string := Python import("string")

"Split a string" println
str := "Brave brave Sir Robin" 
str println
string split(str) println

"Load a C module (.so)" println
t := Python import("time")

writeln("Current time is: ", t time)

"Another way to invoke a method" println
str = "UPPERlower" 
write(str, " --> ")
string invoke("swapcase", str) println

This opens up a whole new world of possibilities. I mean you have every Python module at your disposable from Io. Sometimes you’ll need to tweaks thing a bit since there some things to iron out (like subclassing from Python) but it is quite usable.

Download the source from here.

Unpack it in your bindings directory where you previously unpacked or pulled the Io source and then a simple:

make

will make this go oempf.

Ofcourse you’ll need a recent version of Python installed.

I’ve tested it under osx and it works like a charm. We need much more tests like under linux so please let us know how your fare on irc (#io) or via the Io mailing list. Or comment here of course.

Thanks Aslak ! This is fantastic work.

(ps Aslak wrote this in like 3 days, shows the power of Io :-) )

Read: Introducing IoPython: the Io-Python Bridge

Topic: Ruby Book Sales Surpass Perl & Python Previous Topic   Next Topic Topic: What's New in Edge Rails: Simply RESTful Support - And How to Use It

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use