Sha256: fe4ab0093d24ba433c07f26fff1f32211df9b22162c728f0391fd50ab426146d
Contents?: true
Size: 989 Bytes
Versions: 147
Compression:
Stored size: 989 Bytes
Contents
require 'rbbt-util' require 'pycall/import' module RbbtPython extend PyCall::Import def self.run(mod = nil, imports = nil, &block) if mod if imports pyfrom mod, :import => imports else pyimport mod end end module_eval(&block) end def self.run_log(mod = nil, imports = nil, severity = 0, severity_err = nil, &block) if mod if imports pyfrom mod, :import => imports else pyimport mod end end Log.trap_std("Python STDOUT", "Python STDERR", severity, severity_err) do module_eval(&block) end end def self.run_log_stderr(mod = nil, imports = nil, severity = 0, &block) if mod if imports pyfrom mod, :import => imports else pyimport mod end end Log.trap_stderr("Python STDERR", severity) do module_eval(&block) end end def self.add_path(path) self.run 'sys' do sys.path.append path end end end
Version data entries
147 entries across 147 versions & 1 rubygems