[IPython-dev] Feasilibity of widgets/layout for mimicking this

hugadams hughesadam87 at gmail.com
Wed Aug 20 19:32:35 EDT 2014


GREAT!  Thank you


On Wed, Aug 20, 2014 at 7:03 PM, Fernando Perez [via Python] <
ml-node+s6n5068685h97 at n6.nabble.com> wrote:

>
> On Wed, Aug 20, 2014 at 3:29 PM, Adam Hughes <[hidden email]
> <http://user/SendEmail.jtp?type=node&node=5068685&i=0>> wrote:
>
>> These widgets would need to accept input data, and return output data.
>>  For example in the example Nicholas shared, I'd like the user to be able
>> to pass in a matrix, calculate the synchronous spectra, and then use that
>> for further analysis in subsequent cells in the primary notebook.  Having
>> that as a capability would be huge for us, because we envision a mixed
>> API/GUI workflow.
>
>
> One option here would be to provide a text field for the user to name the
> variables they want returned for any given output (or you can fix those if
> you want), and then have your kernel-side code store them in the user's
> namespace directly.
>
> Here's how you can immediately write variables in ipython:
>
> In [7]: ip = get_ipython()
>
> In [8]: a = 'hello'
>
> In [9]: ip.user_ns['a']
> Out[9]: 'hello'
>
> In [10]: ip.user_ns['a'] = 100
>
> In [11]: a
> Out[11]: 100
>
>
> We can think further about whether other paradigms might be cleaner, but
> I'm not sure that making variables be the return value of the widget itself
> will work all that well. But in the meantime, and until we decide what the
> best solution is in the long term, this will already work and it uses a
> 100% stable IPython api. It may be in the end this *is* a long-term
> solution we all like, but even if not, I think it's pretty serviceable.
>
> Cheers
>
> f
>
>
> --
> Fernando Perez (@fperez_org; http://fperez.org)
> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
> fernando.perez-at-berkeley: contact me here for any direct mail
>
> _______________________________________________
> IPython-dev mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=5068685&i=1>
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://python.6.x6.nabble.com/Feasilibity-of-widgets-layout-for-mimicking-this-tp5068197p5068685.html
>  To unsubscribe from Feasilibity of widgets/layout for mimicking this, click
> here
> <http://python.6.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5068197&code=aHVnaGVzYWRhbTg3QGdtYWlsLmNvbXw1MDY4MTk3fC03NjYyMTgyMzk=>
> .
> NAML
> <http://python.6.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://python.6.x6.nabble.com/Feasilibity-of-widgets-layout-for-mimicking-this-tp5068197p5068690.html
Sent from the IPython - Development mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140820/c43404b0/attachment.html>


More information about the IPython-dev mailing list