Method: RubyPython.run

Defined in:
lib/rubypython.rb

.run(&block) ⇒ Object

Handles the setup and cleanup involved with using the interpreter for you. Note that all Python object will be effectively scope to within the block as the embedded interpreter will be halted at its end. The supplied block is run within the scope of the RubyPython module.

Alternatively the user may prefer RubyPython.session which simples handles initialization and cleanup of the interpreter.



111
112
113
114
115
# File 'lib/rubypython.rb', line 111

def self.run(&block)
  start
    module_eval(&block)
  stop
end