Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    Rython 0.0.1

    Download button

    No screenshots available
    Downloads: 281  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Matt Pizzimenti | More programs
    BSD License / FREE
    May 21st, 2009, 21:34 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Rython description

    Transparently mixes Ruby code into Python

    Rython is a Python library that lets you easily mix Ruby and Python languages together.

    Why would I want to mix Ruby and Python? There are many reasons to run Ruby code within Python:

    * you need a Ruby Gem that provides unique functionality which no Python module provides
    * you need a simpler syntax for

    Quickstart

    First, you need to declare a Ruby context that will run the Ruby code. In this example, we will use Watir (http://wtr.rubyforge.org), a high level web application testing Gem that has no equivalent in Python:

    import rython

    ctx = rython.RubyContext(requires=["rubygems", "watir"])


    Next, instantiate a Watir::Browser object and assign it to a Python variable. The object will be an instance of rython.RubyProxy:

    my_browser = ctx("Watir::Browser.new")

    assert isinstance(my_browser, rython.RubyProxy)


    And now we can call any method on the object instance as well. This example grabs a DIV element from the page by CSS ID 'foobar':

    div_element = my_browser("div(:id, 'foobar')")

    assert isinstance(div_element, rython.RubyProxy)



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    mix Ruby | mix Python | Python library | Ruby | Python | library

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM