Reputation: 3787
I'm using iruby on Jupyter. In python kernel (ipython), one can input a string from notebook by calling input()
function.
Is it possible to achieve the same thing in iruby?
Upvotes: 1
Views: 216
Reputation: 7069
Simple text input is done with IRuby.input
:
name = IRuby.input 'Enter your name'
Multiple fields of input is done with IRuby.form
:
result = IRuby.form do
input :username
button
end
It returns a Hash with the input field names as labels.
Upvotes: 2
Reputation: 828
If you use Jupyter Notebook,
try
IRuby.input
https://github.com/SciRuby/iruby/tree/master/lib/iruby/input
But this input box may not work in Jupyter Lab.
Upvotes: 2