From tabor at broadinstitute.org  Thu Sep 10 15:05:47 2015
From: tabor at broadinstitute.org (Thorin Tabor)
Date: Thu, 10 Sep 2015 15:05:47 -0400
Subject: [IPython-dev] Best way to get the path to the static directory
Message-ID: <55F1D48B.2070303@broadinstitute.org>

When writing a Jupyter notebook extension for Jupyter 4, what is the 
recommended way to get the path to the static directory (you know, the 
one where custom.js and custom.css are being served from)?

In Jupyter 3.x, you used to be able to reference...

    IPython.utils.path.locate_profile() + '/static'

...but that no longer seems to suffice. I know that...

    notebook.notebookapp.DEFAULT_STATIC_FILES_PATH

looks like it might work, but it seems like there ought to be a better 
way. Does anyone have a recommendation?

Thorin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150910/9665c723/attachment.html>

From benjaminrk at gmail.com  Thu Sep 10 16:06:09 2015
From: benjaminrk at gmail.com (MinRK)
Date: Thu, 10 Sep 2015 22:06:09 +0200
Subject: [IPython-dev] Best way to get the path to the static directory
In-Reply-To: <55F1D48B.2070303@broadinstitute.org>
References: <55F1D48B.2070303@broadinstitute.org>
Message-ID: <CAHNn8BUCAFY99oh49V+N59iY_O3=MZjbZQLBVd81tx0Q5gGBBw@mail.gmail.com>

>From a Python API, custom.{js|css} live in
jupyter_core.paths.jupyter_config_dir()
+ '/custom'. Note that you probably shouldn?t be putting any files in there
- if you are writing javascript extensions, they should be placed in
nbextensions via

jupyter nbextension install (4.x) or
ipython install-nbextension (3.x)

-MinRK
?

On Thu, Sep 10, 2015 at 9:05 PM, Thorin Tabor <tabor at broadinstitute.org>
wrote:

> When writing a Jupyter notebook extension for Jupyter 4, what is the
> recommended way to get the path to the static directory (you know, the one
> where custom.js and custom.css are being served from)?
>
> In Jupyter 3.x, you used to be able to reference...
>
> IPython.utils.path.locate_profile() + '/static'
>
> ...but that no longer seems to suffice. I know that...
>
> notebook.notebookapp.DEFAULT_STATIC_FILES_PATH
>
> looks like it might work, but it seems like there ought to be a better
> way. Does anyone have a recommendation?
>
> Thorin
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150910/ad703fee/attachment.html>

From wes.turner at gmail.com  Thu Sep 10 20:00:43 2015
From: wes.turner at gmail.com (Wes Turner)
Date: Thu, 10 Sep 2015 19:00:43 -0500
Subject: [IPython-dev] Best way to get the path to the static directory
In-Reply-To: <CAHNn8BUCAFY99oh49V+N59iY_O3=MZjbZQLBVd81tx0Q5gGBBw@mail.gmail.com>
References: <55F1D48B.2070303@broadinstitute.org>
	<CAHNn8BUCAFY99oh49V+N59iY_O3=MZjbZQLBVd81tx0Q5gGBBw@mail.gmail.com>
Message-ID: <CACfEFw8958iXJb9UtfXa47FNt5m6FMs1Y6bvO2bq-p=FNnzZCA@mail.gmail.com>

On Sep 10, 2015 3:06 PM, "MinRK" <benjaminrk at gmail.com> wrote:
>
> From a Python API, custom.{js|css} live in
jupyter_core.paths.jupyter_config_dir() + '/custom'. Note that you probably
shouldn?t be putting any files in there - if you are writing javascript
extensions, they should be placed in nbextensions via
>
> jupyter nbextension install (4.x) or
> ipython install-nbextension (3.x)
>

Is this doable with a setup.py and jupyter-pip?

https://github.com/jdfreder/jupyter-pip/

> -MinRK
>
> ?
>
> On Thu, Sep 10, 2015 at 9:05 PM, Thorin Tabor <tabor at broadinstitute.org>
wrote:
>>
>> When writing a Jupyter notebook extension for Jupyter 4, what is the
recommended way to get the path to the static directory (you know, the one
where custom.js and custom.css are being served from)?
>>
>> In Jupyter 3.x, you used to be able to reference...
>>>
>>> IPython.utils.path.locate_profile() + '/static'
>>
>> ...but that no longer seems to suffice. I know that...
>>>
>>> notebook.notebookapp.DEFAULT_STATIC_FILES_PATH
>>
>> looks like it might work, but it seems like there ought to be a better
way. Does anyone have a recommendation?
>>
>> Thorin
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150910/e9b7bd43/attachment.html>

From benjaminrk at gmail.com  Mon Sep 14 03:43:16 2015
From: benjaminrk at gmail.com (MinRK)
Date: Mon, 14 Sep 2015 09:43:16 +0200
Subject: [IPython-dev] IPython Parallel manpages
Message-ID: <CAHNn8BX9Wp876iw2+2xBO5kc6S8zrBRv_qenqTk7KYCMr55i-A@mail.gmail.com>

Part of the split meant that the new ipyparallel package no longer installs
manpages for ipcontroller, etc. As they were, the manpages were minimally
useful, pointing users to ?help and not much else. We thought it would be
best to ping the list before officially deciding
<https://github.com/ipython/ipyparallel/pull/23> to not restore these
manpages.

-MinRK
?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150914/b146c30a/attachment.html>

From benjaminrk at gmail.com  Thu Sep 24 09:57:20 2015
From: benjaminrk at gmail.com (MinRK)
Date: Thu, 24 Sep 2015 15:57:20 +0200
Subject: [IPython-dev] [ANN] Security release notebook-4.0.5,
	ipython-3.2.2
In-Reply-To: <CAHNn8BX6Tohoh2XT7keMJsw6bo==afWO1zc7arAzzz5jrsOc_Q@mail.gmail.com>
References: <CAHNn8BX6Tohoh2XT7keMJsw6bo==afWO1zc7arAzzz5jrsOc_Q@mail.gmail.com>
Message-ID: <CAHNn8BVERecW6jRS4bowi2wmR2qHPLehTrPEKS_LD00fWSbQdQ@mail.gmail.com>

(resent because of ipython-dev mailing list trouble)

We?ve just pushed a security release of notebook-4.0.5 and IPython-3.2.2,
fixing two vulnerabilities associated with maliciously crafted files.

   - malicious filenames can execute code: CVE-2015-6938
   <http://www.openwall.com/lists/oss-security/2015/09/02/3>
   - attempting to edit malicious text files with invalid encoding can
   result in execution CVE-2015-7337
   <http://www.openwall.com/lists/oss-security/2015/09/16/3>

Thanks to Juan Broull?n, Jonathan Kamens, and Scott Sanderson for the
reports.

-MinRK
?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/337b2bf9/attachment.html>

From kikocorreoso at gmail.com  Thu Sep 24 16:12:15 2015
From: kikocorreoso at gmail.com (Kiko)
Date: Thu, 24 Sep 2015 22:12:15 +0200
Subject: [IPython-dev] Data from js to Python
Message-ID: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>

Hi all,

Is there a way to get information from javascript into Python?

I googled about it but I couldn't find related info.

Thanks!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/532740b6/attachment.html>

From jakegod14 at gmail.com  Thu Sep 24 16:17:46 2015
From: jakegod14 at gmail.com (Jacob Evans)
Date: Thu, 24 Sep 2015 14:17:46 -0600
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
Message-ID: <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>

Hey Kiko,
What kind of data are you trying to get into python and in what way?

I think what your looking for is called JSON
https://en.wikipedia.org/wiki/JSON

What you going to do is format your JavaScript output into JSON then
processes in python with a package like json.

Example here
http://docs.python-guide.org/en/latest/scenarios/json/


On Thu, Sep 24, 2015 at 2:12 PM, Kiko <kikocorreoso at gmail.com> wrote:

> Hi all,
>
> Is there a way to get information from javascript into Python?
>
> I googled about it but I couldn't find related info.
>
> Thanks!!
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/38afc427/attachment.html>

From kikocorreoso at gmail.com  Thu Sep 24 16:25:35 2015
From: kikocorreoso at gmail.com (Kiko)
Date: Thu, 24 Sep 2015 22:25:35 +0200
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
Message-ID: <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>

2015-09-24 22:17 GMT+02:00 Jacob Evans <jakegod14 at gmail.com>:

> Hey Kiko,
> What kind of data are you trying to get into python and in what way?
>
> I think what your looking for is called JSON
> https://en.wikipedia.org/wiki/JSON
>
> What you going to do is format your JavaScript output into JSON then
> processes in python with a package like json.
>
> Example here
> http://docs.python-guide.org/en/latest/scenarios/json/
>
>
Thanks Jacob,

I think I didn't explain it very well.

A dummy example, I have a D3 scatter plot on the notebook and I want to
select some of the points with the mouse and then I want this selection to
be available in Python to analyse it or whatever.

Maybe this example make things clearer.


>
> On Thu, Sep 24, 2015 at 2:12 PM, Kiko <kikocorreoso at gmail.com> wrote:
>
>> Hi all,
>>
>> Is there a way to get information from javascript into Python?
>>
>> I googled about it but I couldn't find related info.
>>
>> Thanks!!
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/e4b88f6c/attachment.html>

From wes.turner at gmail.com  Thu Sep 24 17:25:09 2015
From: wes.turner at gmail.com (Wes Turner)
Date: Thu, 24 Sep 2015 16:25:09 -0500
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
Message-ID: <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>

https://www.google.com/search?q=ipython+d3

Vega visualization grammar
| Docs: https://github.com/vega/vega/wiki/Vega-and-D3
| Homepage: https://vega.github.io/

mpld3: matplotlib + d3
| Homepage: http://mpld3.github.io/

IPython widgets (interactive)
| Docs: https://github.com/ipython/ipython/wiki/widgets

pythreejs IPython Notebook extension
| Src:
https://github.com/jovyan/pythreejs/blob/master/pythreejs/pythreejs.py
three.js
| Src:
https://github.com/jovyan/pythreejs/blob/master/pythreejs/nbextension/pythreejs.js

* [ ] JSON-LD
   * http://json-ld.org/playground/
On Sep 24, 2015 3:25 PM, "Kiko" <kikocorreoso at gmail.com> wrote:

>
>
> 2015-09-24 22:17 GMT+02:00 Jacob Evans <jakegod14 at gmail.com>:
>
>> Hey Kiko,
>> What kind of data are you trying to get into python and in what way?
>>
>> I think what your looking for is called JSON
>> https://en.wikipedia.org/wiki/JSON
>>
>> What you going to do is format your JavaScript output into JSON then
>> processes in python with a package like json.
>>
>> Example here
>> http://docs.python-guide.org/en/latest/scenarios/json/
>>
>>
> Thanks Jacob,
>
> I think I didn't explain it very well.
>
> A dummy example, I have a D3 scatter plot on the notebook and I want to
> select some of the points with the mouse and then I want this selection to
> be available in Python to analyse it or whatever.
>
> Maybe this example make things clearer.
>
>
>>
>> On Thu, Sep 24, 2015 at 2:12 PM, Kiko <kikocorreoso at gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> Is there a way to get information from javascript into Python?
>>>
>>> I googled about it but I couldn't find related info.
>>>
>>> Thanks!!
>>>
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/1059570b/attachment.html>

From kikocorreoso at gmail.com  Thu Sep 24 17:32:25 2015
From: kikocorreoso at gmail.com (Kiko)
Date: Thu, 24 Sep 2015 23:32:25 +0200
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
 <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
Message-ID: <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>

2015-09-24 23:25 GMT+02:00 Wes Turner <wes.turner at gmail.com>:

> https://www.google.com/search?q=ipython+d3
>
> Vega visualization grammar
> | Docs: https://github.com/vega/vega/wiki/Vega-and-D3
> | Homepage: https://vega.github.io/
>
> mpld3: matplotlib + d3
> | Homepage: http://mpld3.github.io/
>
> IPython widgets (interactive)
> | Docs: https://github.com/ipython/ipython/wiki/widgets
>
> pythreejs IPython Notebook extension
> | Src:
> https://github.com/jovyan/pythreejs/blob/master/pythreejs/pythreejs.py
> three.js
> | Src:
> https://github.com/jovyan/pythreejs/blob/master/pythreejs/nbextension/pythreejs.js
>
> * [ ] JSON-LD
>    * http://json-ld.org/playground/
>
Thanks.

Yes, I think all of these allow you to send information from Python to js
but I'm talking about the opposite way. For instance, select an area in an
openlayers map and then get the coordinates of the area back to Python.



> On Sep 24, 2015 3:25 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
>
>>
>>
>> 2015-09-24 22:17 GMT+02:00 Jacob Evans <jakegod14 at gmail.com>:
>>
>>> Hey Kiko,
>>> What kind of data are you trying to get into python and in what way?
>>>
>>> I think what your looking for is called JSON
>>> https://en.wikipedia.org/wiki/JSON
>>>
>>> What you going to do is format your JavaScript output into JSON then
>>> processes in python with a package like json.
>>>
>>> Example here
>>> http://docs.python-guide.org/en/latest/scenarios/json/
>>>
>>>
>> Thanks Jacob,
>>
>> I think I didn't explain it very well.
>>
>> A dummy example, I have a D3 scatter plot on the notebook and I want to
>> select some of the points with the mouse and then I want this selection to
>> be available in Python to analyse it or whatever.
>>
>> Maybe this example make things clearer.
>>
>>
>>>
>>> On Thu, Sep 24, 2015 at 2:12 PM, Kiko <kikocorreoso at gmail.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> Is there a way to get information from javascript into Python?
>>>>
>>>> I googled about it but I couldn't find related info.
>>>>
>>>> Thanks!!
>>>>
>>>> _______________________________________________
>>>> IPython-dev mailing list
>>>> IPython-dev at scipy.org
>>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>
>>>>
>>>
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/d5fabb3c/attachment.html>

From wes.turner at gmail.com  Thu Sep 24 17:41:55 2015
From: wes.turner at gmail.com (Wes Turner)
Date: Thu, 24 Sep 2015 16:41:55 -0500
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
 <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
 <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>
Message-ID: <CACfEFw9uWP=UbgPhxQ8-eMORVEdqQgrX+=R3==jg-PaEhvXMxA@mail.gmail.com>

On Sep 24, 2015 4:32 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
>
> 2015-09-24 23:25 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>>
>> https://www.google.com/search?q=ipython+d3
>>
>> Vega visualization grammar
>> | Docs: https://github.com/vega/vega/wiki/Vega-and-D3
>> | Homepage: https://vega.github.io/
>>
>> mpld3: matplotlib + d3
>> | Homepage: http://mpld3.github.io/
>>
>> IPython widgets (interactive)
>> | Docs: https://github.com/ipython/ipython/wiki/widgets
>>
>> pythreejs IPython Notebook extension
>> | Src:
https://github.com/jovyan/pythreejs/blob/master/pythreejs/pythreejs.py
three.js
>> | Src:
https://github.com/jovyan/pythreejs/blob/master/pythreejs/nbextension/pythreejs.js
>>
>> * [ ] JSON-LD
>>    * http://json-ld.org/playground/
>
> Thanks.
>
> Yes, I think all of these allow you to send information from Python to js
but I'm talking about the opposite way. For instance, select an area in an
openlayers map and then get the coordinates of the area back to Python.

IIUC, that's more or less how widget controls operate.

also, here's this:

ipython-jsobject
Src: https://github.com/jdfreder/ipython-jsobject

    JSON-LD (and/or e.g. CSVW) with RDFJS could be helpful:
https://github.com/rdfjs/rdfjs.org
     * https://github.com/rdfjs/rdfjs.org/wiki/Projects #LinkedData
     * http://www.w3.org/community/rdfjs/wiki/Comparison_of_RDFJS_libraries
       * [ ] TODO: link these resources

>
>
>>
>> On Sep 24, 2015 3:25 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
>>>
>>>
>>>
>>> 2015-09-24 22:17 GMT+02:00 Jacob Evans <jakegod14 at gmail.com>:
>>>>
>>>> Hey Kiko,
>>>> What kind of data are you trying to get into python and in what way?
>>>>
>>>> I think what your looking for is called JSON
>>>> https://en.wikipedia.org/wiki/JSON
>>>>
>>>> What you going to do is format your JavaScript output into JSON then
processes in python with a package like json.
>>>>
>>>> Example here
>>>> http://docs.python-guide.org/en/latest/scenarios/json/
>>>>
>>>
>>> Thanks Jacob,
>>>
>>> I think I didn't explain it very well.
>>>
>>> A dummy example, I have a D3 scatter plot on the notebook and I want to
select some of the points with the mouse and then I want this selection to
be available in Python to analyse it or whatever.
>>>
>>> Maybe this example make things clearer.
>>>
>>>>
>>>>
>>>> On Thu, Sep 24, 2015 at 2:12 PM, Kiko <kikocorreoso at gmail.com> wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> Is there a way to get information from javascript into Python?
>>>>>
>>>>> I googled about it but I couldn't find related info.
>>>>>
>>>>> Thanks!!
>>>>>
>>>>> _______________________________________________
>>>>> IPython-dev mailing list
>>>>> IPython-dev at scipy.org
>>>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> IPython-dev mailing list
>>>> IPython-dev at scipy.org
>>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>
>>>
>>>
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/6dfd1884/attachment.html>

From kikocorreoso at gmail.com  Thu Sep 24 17:44:20 2015
From: kikocorreoso at gmail.com (Kiko)
Date: Thu, 24 Sep 2015 23:44:20 +0200
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CACfEFw9uWP=UbgPhxQ8-eMORVEdqQgrX+=R3==jg-PaEhvXMxA@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
 <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
 <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>
 <CACfEFw9uWP=UbgPhxQ8-eMORVEdqQgrX+=R3==jg-PaEhvXMxA@mail.gmail.com>
Message-ID: <CAB-sx61eOTYCbh6wbgdqQOGsO795OY5RUqjj+3w6v8mvUoZk0A@mail.gmail.com>

2015-09-24 23:41 GMT+02:00 Wes Turner <wes.turner at gmail.com>:

>
> On Sep 24, 2015 4:32 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
> >
> > 2015-09-24 23:25 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
> >>
> >> https://www.google.com/search?q=ipython+d3
> >>
> >> Vega visualization grammar
> >> | Docs: https://github.com/vega/vega/wiki/Vega-and-D3
> >> | Homepage: https://vega.github.io/
> >>
> >> mpld3: matplotlib + d3
> >> | Homepage: http://mpld3.github.io/
> >>
> >> IPython widgets (interactive)
> >> | Docs: https://github.com/ipython/ipython/wiki/widgets
> >>
> >> pythreejs IPython Notebook extension
> >> | Src:
> https://github.com/jovyan/pythreejs/blob/master/pythreejs/pythreejs.py
> three.js
> >> | Src:
> https://github.com/jovyan/pythreejs/blob/master/pythreejs/nbextension/pythreejs.js
> >>
> >> * [ ] JSON-LD
> >>    * http://json-ld.org/playground/
> >
> > Thanks.
> >
> > Yes, I think all of these allow you to send information from Python to
> js but I'm talking about the opposite way. For instance, select an area in
> an openlayers map and then get the coordinates of the area back to Python.
>
> IIUC, that's more or less how widget controls operate.
>
> also, here's this:
>
> ipython-jsobject
> Src: https://github.com/jdfreder/ipython-jsobject
>
>     JSON-LD (and/or e.g. CSVW) with RDFJS could be helpful:
> https://github.com/rdfjs/rdfjs.org
>      * https://github.com/rdfjs/rdfjs.org/wiki/Projects #LinkedData
>      *
> http://www.w3.org/community/rdfjs/wiki/Comparison_of_RDFJS_libraries
>        * [ ] TODO: link these resources
>
Thanks, I will review that to check if I can obtain any hints.


> >
> >
> >>
> >> On Sep 24, 2015 3:25 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
> >>>
> >>>
> >>>
> >>> 2015-09-24 22:17 GMT+02:00 Jacob Evans <jakegod14 at gmail.com>:
> >>>>
> >>>> Hey Kiko,
> >>>> What kind of data are you trying to get into python and in what way?
> >>>>
> >>>> I think what your looking for is called JSON
> >>>> https://en.wikipedia.org/wiki/JSON
> >>>>
> >>>> What you going to do is format your JavaScript output into JSON then
> processes in python with a package like json.
> >>>>
> >>>> Example here
> >>>> http://docs.python-guide.org/en/latest/scenarios/json/
> >>>>
> >>>
> >>> Thanks Jacob,
> >>>
> >>> I think I didn't explain it very well.
> >>>
> >>> A dummy example, I have a D3 scatter plot on the notebook and I want
> to select some of the points with the mouse and then I want this selection
> to be available in Python to analyse it or whatever.
> >>>
> >>> Maybe this example make things clearer.
> >>>
> >>>>
> >>>>
> >>>> On Thu, Sep 24, 2015 at 2:12 PM, Kiko <kikocorreoso at gmail.com> wrote:
> >>>>>
> >>>>> Hi all,
> >>>>>
> >>>>> Is there a way to get information from javascript into Python?
> >>>>>
> >>>>> I googled about it but I couldn't find related info.
> >>>>>
> >>>>> Thanks!!
> >>>>>
> >>>>> _______________________________________________
> >>>>> IPython-dev mailing list
> >>>>> IPython-dev at scipy.org
> >>>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
> >>>>>
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> IPython-dev mailing list
> >>>> IPython-dev at scipy.org
> >>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
> >>>>
> >>>
> >>>
> >>> _______________________________________________
> >>> IPython-dev mailing list
> >>> IPython-dev at scipy.org
> >>> https://mail.scipy.org/mailman/listinfo/ipython-dev
> >>>
> >>
> >> _______________________________________________
> >> IPython-dev mailing list
> >> IPython-dev at scipy.org
> >> https://mail.scipy.org/mailman/listinfo/ipython-dev
> >>
> >
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > https://mail.scipy.org/mailman/listinfo/ipython-dev
> >
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/6cac7fda/attachment.html>

From wes.turner at gmail.com  Thu Sep 24 17:56:55 2015
From: wes.turner at gmail.com (Wes Turner)
Date: Thu, 24 Sep 2015 16:56:55 -0500
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CAB-sx61eOTYCbh6wbgdqQOGsO795OY5RUqjj+3w6v8mvUoZk0A@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
 <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
 <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>
 <CACfEFw9uWP=UbgPhxQ8-eMORVEdqQgrX+=R3==jg-PaEhvXMxA@mail.gmail.com>
 <CAB-sx61eOTYCbh6wbgdqQOGsO795OY5RUqjj+3w6v8mvUoZk0A@mail.gmail.com>
Message-ID: <CACfEFw9LzNfh8uL6MRUMWR03dSRXkG3LNaUhnzAB6Ha-XPJ0Nw@mail.gmail.com>

"IPython openlayers"
https://github.com/kikocorreoso/brythonmagic/blob/master/notebooks/OpenLayers%20(python)%20tutorial.ipynb

this has an HTTP API (MapFish) w/ GeoAlchemy and GeoJSON:
| Src: https://pypi.python.org/pypi/papyrus
| Docs: http://papyrus.readthedocs.org/en/latest/

* http://matplotlib.org/basemap/
* http://bokeh.pydata.org/en/latest/docs/dev_guide/server.html
On Sep 24, 2015 4:44 PM, "Kiko" <kikocorreoso at gmail.com> wrote:

>
>
> 2015-09-24 23:41 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>
>>
>> On Sep 24, 2015 4:32 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
>> >
>> > 2015-09-24 23:25 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>> >>
>> >> https://www.google.com/search?q=ipython+d3
>> >>
>> >> Vega visualization grammar
>> >> | Docs: https://github.com/vega/vega/wiki/Vega-and-D3
>> >> | Homepage: https://vega.github.io/
>> >>
>> >> mpld3: matplotlib + d3
>> >> | Homepage: http://mpld3.github.io/
>> >>
>> >> IPython widgets (interactive)
>> >> | Docs: https://github.com/ipython/ipython/wiki/widgets
>> >>
>> >> pythreejs IPython Notebook extension
>> >> | Src:
>> https://github.com/jovyan/pythreejs/blob/master/pythreejs/pythreejs.py
>> three.js
>> >> | Src:
>> https://github.com/jovyan/pythreejs/blob/master/pythreejs/nbextension/pythreejs.js
>> >>
>> >> * [ ] JSON-LD
>> >>    * http://json-ld.org/playground/
>> >
>> > Thanks.
>> >
>> > Yes, I think all of these allow you to send information from Python to
>> js but I'm talking about the opposite way. For instance, select an area in
>> an openlayers map and then get the coordinates of the area back to Python.
>>
>> IIUC, that's more or less how widget controls operate.
>>
>> also, here's this:
>>
>> ipython-jsobject
>> Src: https://github.com/jdfreder/ipython-jsobject
>>
>>     JSON-LD (and/or e.g. CSVW) with RDFJS could be helpful:
>> https://github.com/rdfjs/rdfjs.org
>>      * https://github.com/rdfjs/rdfjs.org/wiki/Projects #LinkedData
>>      *
>> http://www.w3.org/community/rdfjs/wiki/Comparison_of_RDFJS_libraries
>>        * [ ] TODO: link these resources
>>
> Thanks, I will review that to check if I can obtain any hints.
>
>
>> >
>> >
>> >>
>> >> On Sep 24, 2015 3:25 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
>> >>>
>> >>>
>> >>>
>> >>> 2015-09-24 22:17 GMT+02:00 Jacob Evans <jakegod14 at gmail.com>:
>> >>>>
>> >>>> Hey Kiko,
>> >>>> What kind of data are you trying to get into python and in what way?
>> >>>>
>> >>>> I think what your looking for is called JSON
>> >>>> https://en.wikipedia.org/wiki/JSON
>> >>>>
>> >>>> What you going to do is format your JavaScript output into JSON then
>> processes in python with a package like json.
>> >>>>
>> >>>> Example here
>> >>>> http://docs.python-guide.org/en/latest/scenarios/json/
>> >>>>
>> >>>
>> >>> Thanks Jacob,
>> >>>
>> >>> I think I didn't explain it very well.
>> >>>
>> >>> A dummy example, I have a D3 scatter plot on the notebook and I want
>> to select some of the points with the mouse and then I want this selection
>> to be available in Python to analyse it or whatever.
>> >>>
>> >>> Maybe this example make things clearer.
>> >>>
>> >>>>
>> >>>>
>> >>>> On Thu, Sep 24, 2015 at 2:12 PM, Kiko <kikocorreoso at gmail.com>
>> wrote:
>> >>>>>
>> >>>>> Hi all,
>> >>>>>
>> >>>>> Is there a way to get information from javascript into Python?
>> >>>>>
>> >>>>> I googled about it but I couldn't find related info.
>> >>>>>
>> >>>>> Thanks!!
>> >>>>>
>> >>>>> _______________________________________________
>> >>>>> IPython-dev mailing list
>> >>>>> IPython-dev at scipy.org
>> >>>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>> >>>>>
>> >>>>
>> >>>>
>> >>>> _______________________________________________
>> >>>> IPython-dev mailing list
>> >>>> IPython-dev at scipy.org
>> >>>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>> >>>>
>> >>>
>> >>>
>> >>> _______________________________________________
>> >>> IPython-dev mailing list
>> >>> IPython-dev at scipy.org
>> >>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>> >>>
>> >>
>> >> _______________________________________________
>> >> IPython-dev mailing list
>> >> IPython-dev at scipy.org
>> >> https://mail.scipy.org/mailman/listinfo/ipython-dev
>> >>
>> >
>> >
>> > _______________________________________________
>> > IPython-dev mailing list
>> > IPython-dev at scipy.org
>> > https://mail.scipy.org/mailman/listinfo/ipython-dev
>> >
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/917f4257/attachment.html>

From doug.blank at gmail.com  Thu Sep 24 17:59:45 2015
From: doug.blank at gmail.com (Doug Blank)
Date: Thu, 24 Sep 2015 17:59:45 -0400
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CAB-sx61eOTYCbh6wbgdqQOGsO795OY5RUqjj+3w6v8mvUoZk0A@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
 <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
 <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>
 <CACfEFw9uWP=UbgPhxQ8-eMORVEdqQgrX+=R3==jg-PaEhvXMxA@mail.gmail.com>
 <CAB-sx61eOTYCbh6wbgdqQOGsO795OY5RUqjj+3w6v8mvUoZk0A@mail.gmail.com>
Message-ID: <CAAusYCiCe70iT0othybAni427UB=xu1h7kGD+VwC55o=pwvODw@mail.gmail.com>

It isn't too complicated, if you can format your JavaScript in the kernel
language; here is JavaScript talking to Python:

%%javascript
var javascript_var = 2 * 4 + 8;
IPython.notebook.kernel.execute("python_var = " + javascript_var);

Hope that helps.

-Doug


On Thu, Sep 24, 2015 at 5:44 PM, Kiko <kikocorreoso at gmail.com> wrote:

>
>
> 2015-09-24 23:41 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>
>>
>> On Sep 24, 2015 4:32 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
>> >
>> > 2015-09-24 23:25 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>> >>
>> >> https://www.google.com/search?q=ipython+d3
>> >>
>> >> Vega visualization grammar
>> >> | Docs: https://github.com/vega/vega/wiki/Vega-and-D3
>> >> | Homepage: https://vega.github.io/
>> >>
>> >> mpld3: matplotlib + d3
>> >> | Homepage: http://mpld3.github.io/
>> >>
>> >> IPython widgets (interactive)
>> >> | Docs: https://github.com/ipython/ipython/wiki/widgets
>> >>
>> >> pythreejs IPython Notebook extension
>> >> | Src:
>> https://github.com/jovyan/pythreejs/blob/master/pythreejs/pythreejs.py
>> three.js
>> >> | Src:
>> https://github.com/jovyan/pythreejs/blob/master/pythreejs/nbextension/pythreejs.js
>> >>
>> >> * [ ] JSON-LD
>> >>    * http://json-ld.org/playground/
>> >
>> > Thanks.
>> >
>> > Yes, I think all of these allow you to send information from Python to
>> js but I'm talking about the opposite way. For instance, select an area in
>> an openlayers map and then get the coordinates of the area back to Python.
>>
>> IIUC, that's more or less how widget controls operate.
>>
>> also, here's this:
>>
>> ipython-jsobject
>> Src: https://github.com/jdfreder/ipython-jsobject
>>
>>     JSON-LD (and/or e.g. CSVW) with RDFJS could be helpful:
>> https://github.com/rdfjs/rdfjs.org
>>      * https://github.com/rdfjs/rdfjs.org/wiki/Projects #LinkedData
>>      *
>> http://www.w3.org/community/rdfjs/wiki/Comparison_of_RDFJS_libraries
>>        * [ ] TODO: link these resources
>>
> Thanks, I will review that to check if I can obtain any hints.
>
>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/f720aae8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2015-09-24 17:56:44.png
Type: image/png
Size: 12121 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/f720aae8/attachment.png>

From wes.turner at gmail.com  Thu Sep 24 18:03:49 2015
From: wes.turner at gmail.com (Wes Turner)
Date: Thu, 24 Sep 2015 17:03:49 -0500
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CAAusYCiCe70iT0othybAni427UB=xu1h7kGD+VwC55o=pwvODw@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
 <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
 <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>
 <CACfEFw9uWP=UbgPhxQ8-eMORVEdqQgrX+=R3==jg-PaEhvXMxA@mail.gmail.com>
 <CAB-sx61eOTYCbh6wbgdqQOGsO795OY5RUqjj+3w6v8mvUoZk0A@mail.gmail.com>
 <CAAusYCiCe70iT0othybAni427UB=xu1h7kGD+VwC55o=pwvODw@mail.gmail.com>
Message-ID: <CACfEFw9NXEKU4tUTBOesR379k5psb_m2FEgtzjTrCt=x1HE12g@mail.gmail.com>

On Sep 24, 2015 4:59 PM, "Doug Blank" <doug.blank at gmail.com> wrote:
>
> It isn't too complicated, if you can format your JavaScript in the kernel
language; here is JavaScript talking to Python:
>
> %%javascript
> var javascript_var = 2 * 4 + 8;
> IPython.notebook.kernel.execute("python_var = " + javascript_var);

there's a risk of code injection here (with the privs of the e.g. tmpnb
notebook user).

https://en.wikipedia.org/wiki/Code_injection

if possible, it's usually recommended to serialize with eg.
json.dump[s]
and call a static routine.

>
> Hope that helps.
>
> -Doug
>
>
> On Thu, Sep 24, 2015 at 5:44 PM, Kiko <kikocorreoso at gmail.com> wrote:
>>
>>
>>
>> 2015-09-24 23:41 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>>>
>>>
>>> On Sep 24, 2015 4:32 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
>>> >
>>> > 2015-09-24 23:25 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>>> >>
>>> >> https://www.google.com/search?q=ipython+d3
>>> >>
>>> >> Vega visualization grammar
>>> >> | Docs: https://github.com/vega/vega/wiki/Vega-and-D3
>>> >> | Homepage: https://vega.github.io/
>>> >>
>>> >> mpld3: matplotlib + d3
>>> >> | Homepage: http://mpld3.github.io/
>>> >>
>>> >> IPython widgets (interactive)
>>> >> | Docs: https://github.com/ipython/ipython/wiki/widgets
>>> >>
>>> >> pythreejs IPython Notebook extension
>>> >> | Src:
https://github.com/jovyan/pythreejs/blob/master/pythreejs/pythreejs.py
three.js
>>> >> | Src:
https://github.com/jovyan/pythreejs/blob/master/pythreejs/nbextension/pythreejs.js
>>> >>
>>> >> * [ ] JSON-LD
>>> >>    * http://json-ld.org/playground/
>>> >
>>> > Thanks.
>>> >
>>> > Yes, I think all of these allow you to send information from Python
to js but I'm talking about the opposite way. For instance, select an area
in an openlayers map and then get the coordinates of the area back to
Python.
>>>
>>> IIUC, that's more or less how widget controls operate.
>>>
>>> also, here's this:
>>>
>>> ipython-jsobject
>>> Src: https://github.com/jdfreder/ipython-jsobject
>>>
>>>     JSON-LD (and/or e.g. CSVW) with RDFJS could be helpful:
https://github.com/rdfjs/rdfjs.org
>>>      * https://github.com/rdfjs/rdfjs.org/wiki/Projects #LinkedData
>>>      *
http://www.w3.org/community/rdfjs/wiki/Comparison_of_RDFJS_libraries
>>>        * [ ] TODO: link these resources
>>
>> Thanks, I will review that to check if I can obtain any hints.
>>
>>>
>>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/fe757e47/attachment.html>

From jakevdp at cs.washington.edu  Thu Sep 24 18:06:06 2015
From: jakevdp at cs.washington.edu (Jacob Vanderplas)
Date: Thu, 24 Sep 2015 15:06:06 -0700
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CAAusYCiCe70iT0othybAni427UB=xu1h7kGD+VwC55o=pwvODw@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
 <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
 <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>
 <CACfEFw9uWP=UbgPhxQ8-eMORVEdqQgrX+=R3==jg-PaEhvXMxA@mail.gmail.com>
 <CAB-sx61eOTYCbh6wbgdqQOGsO795OY5RUqjj+3w6v8mvUoZk0A@mail.gmail.com>
 <CAAusYCiCe70iT0othybAni427UB=xu1h7kGD+VwC55o=pwvODw@mail.gmail.com>
Message-ID: <CACpqBg3szFeV8OozfXk7Kpnv74niBjzMbz5YMZfR55qU1euhcg@mail.gmail.com>

For your plotting example in particular, you might look at the Bokeh
library http://bokeh.pydata.org/
It allows you to create html/javascript plots, and do things like use a
selection box to choose points, and execute a Python callback on the
selection,
   Jake

 Jake VanderPlas
 Senior Data Science Fellow
 Director of Research in Physical Sciences
 University of Washington eScience Institute

On Thu, Sep 24, 2015 at 2:59 PM, Doug Blank <doug.blank at gmail.com> wrote:

> It isn't too complicated, if you can format your JavaScript in the kernel
> language; here is JavaScript talking to Python:
>
> %%javascript
> var javascript_var = 2 * 4 + 8;
> IPython.notebook.kernel.execute("python_var = " + javascript_var);
>
> Hope that helps.
>
> -Doug
>
>
> On Thu, Sep 24, 2015 at 5:44 PM, Kiko <kikocorreoso at gmail.com> wrote:
>
>>
>>
>> 2015-09-24 23:41 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>>
>>>
>>> On Sep 24, 2015 4:32 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
>>> >
>>> > 2015-09-24 23:25 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>>> >>
>>> >> https://www.google.com/search?q=ipython+d3
>>> >>
>>> >> Vega visualization grammar
>>> >> | Docs: https://github.com/vega/vega/wiki/Vega-and-D3
>>> >> | Homepage: https://vega.github.io/
>>> >>
>>> >> mpld3: matplotlib + d3
>>> >> | Homepage: http://mpld3.github.io/
>>> >>
>>> >> IPython widgets (interactive)
>>> >> | Docs: https://github.com/ipython/ipython/wiki/widgets
>>> >>
>>> >> pythreejs IPython Notebook extension
>>> >> | Src:
>>> https://github.com/jovyan/pythreejs/blob/master/pythreejs/pythreejs.py
>>> three.js
>>> >> | Src:
>>> https://github.com/jovyan/pythreejs/blob/master/pythreejs/nbextension/pythreejs.js
>>> >>
>>> >> * [ ] JSON-LD
>>> >>    * http://json-ld.org/playground/
>>> >
>>> > Thanks.
>>> >
>>> > Yes, I think all of these allow you to send information from Python to
>>> js but I'm talking about the opposite way. For instance, select an area in
>>> an openlayers map and then get the coordinates of the area back to Python.
>>>
>>> IIUC, that's more or less how widget controls operate.
>>>
>>> also, here's this:
>>>
>>> ipython-jsobject
>>> Src: https://github.com/jdfreder/ipython-jsobject
>>>
>>>     JSON-LD (and/or e.g. CSVW) with RDFJS could be helpful:
>>> https://github.com/rdfjs/rdfjs.org
>>>      * https://github.com/rdfjs/rdfjs.org/wiki/Projects #LinkedData
>>>      *
>>> http://www.w3.org/community/rdfjs/wiki/Comparison_of_RDFJS_libraries
>>>        * [ ] TODO: link these resources
>>>
>> Thanks, I will review that to check if I can obtain any hints.
>>
>>
>>>
>>>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/e342b156/attachment.html>

From kikocorreoso at gmail.com  Thu Sep 24 18:34:20 2015
From: kikocorreoso at gmail.com (Kiko)
Date: Fri, 25 Sep 2015 00:34:20 +0200
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CAAusYCiCe70iT0othybAni427UB=xu1h7kGD+VwC55o=pwvODw@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
 <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
 <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>
 <CACfEFw9uWP=UbgPhxQ8-eMORVEdqQgrX+=R3==jg-PaEhvXMxA@mail.gmail.com>
 <CAB-sx61eOTYCbh6wbgdqQOGsO795OY5RUqjj+3w6v8mvUoZk0A@mail.gmail.com>
 <CAAusYCiCe70iT0othybAni427UB=xu1h7kGD+VwC55o=pwvODw@mail.gmail.com>
Message-ID: <CAB-sx606UQsGYNk6JyuNO-54ytCV7xvp5trtOtgrh4shnmh34Q@mail.gmail.com>

2015-09-24 23:59 GMT+02:00 Doug Blank <doug.blank at gmail.com>:

> It isn't too complicated, if you can format your JavaScript in the kernel
> language; here is JavaScript talking to Python:
>
> %%javascript
> var javascript_var = 2 * 4 + 8;
> IPython.notebook.kernel.execute("python_var = " + javascript_var);
>
> Hope that helps.
>

Hi Doug,

It helps but it is not what I want.

I want to access a object stored in the global js namespace of the browser.
For instance, this is available in your js console on the browser when you
work with IPython/Jupyter:
*IPython.notebook.notebook_name*

But if I do:

*%%javascriptIPython.notebook.kernel.execute("python_var = " +
IPython.notebook.notebook_name);*

It doesn't work.

In your example, where is *javascript_var* stored?


> -Doug
>
>
> On Thu, Sep 24, 2015 at 5:44 PM, Kiko <kikocorreoso at gmail.com> wrote:
>
>>
>>
>> 2015-09-24 23:41 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>>
>>>
>>> On Sep 24, 2015 4:32 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
>>> >
>>> > 2015-09-24 23:25 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>>> >>
>>> >> https://www.google.com/search?q=ipython+d3
>>> >>
>>> >> Vega visualization grammar
>>> >> | Docs: https://github.com/vega/vega/wiki/Vega-and-D3
>>> >> | Homepage: https://vega.github.io/
>>> >>
>>> >> mpld3: matplotlib + d3
>>> >> | Homepage: http://mpld3.github.io/
>>> >>
>>> >> IPython widgets (interactive)
>>> >> | Docs: https://github.com/ipython/ipython/wiki/widgets
>>> >>
>>> >> pythreejs IPython Notebook extension
>>> >> | Src:
>>> https://github.com/jovyan/pythreejs/blob/master/pythreejs/pythreejs.py
>>> three.js
>>> >> | Src:
>>> https://github.com/jovyan/pythreejs/blob/master/pythreejs/nbextension/pythreejs.js
>>> >>
>>> >> * [ ] JSON-LD
>>> >>    * http://json-ld.org/playground/
>>> >
>>> > Thanks.
>>> >
>>> > Yes, I think all of these allow you to send information from Python to
>>> js but I'm talking about the opposite way. For instance, select an area in
>>> an openlayers map and then get the coordinates of the area back to Python.
>>>
>>> IIUC, that's more or less how widget controls operate.
>>>
>>> also, here's this:
>>>
>>> ipython-jsobject
>>> Src: https://github.com/jdfreder/ipython-jsobject
>>>
>>>     JSON-LD (and/or e.g. CSVW) with RDFJS could be helpful:
>>> https://github.com/rdfjs/rdfjs.org
>>>      * https://github.com/rdfjs/rdfjs.org/wiki/Projects #LinkedData
>>>      *
>>> http://www.w3.org/community/rdfjs/wiki/Comparison_of_RDFJS_libraries
>>>        * [ ] TODO: link these resources
>>>
>> Thanks, I will review that to check if I can obtain any hints.
>>
>>
>>>
>>>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150925/50956f33/attachment.html>

From doug.blank at gmail.com  Thu Sep 24 19:19:18 2015
From: doug.blank at gmail.com (Doug Blank)
Date: Thu, 24 Sep 2015 19:19:18 -0400
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CAB-sx606UQsGYNk6JyuNO-54ytCV7xvp5trtOtgrh4shnmh34Q@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
 <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
 <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>
 <CACfEFw9uWP=UbgPhxQ8-eMORVEdqQgrX+=R3==jg-PaEhvXMxA@mail.gmail.com>
 <CAB-sx61eOTYCbh6wbgdqQOGsO795OY5RUqjj+3w6v8mvUoZk0A@mail.gmail.com>
 <CAAusYCiCe70iT0othybAni427UB=xu1h7kGD+VwC55o=pwvODw@mail.gmail.com>
 <CAB-sx606UQsGYNk6JyuNO-54ytCV7xvp5trtOtgrh4shnmh34Q@mail.gmail.com>
Message-ID: <CAAusYCiyAwpw0gyos2o3sf7+UKyLAWpyS72Mzp-M5nBeyJjjnA@mail.gmail.com>

On Thu, Sep 24, 2015 at 6:34 PM, Kiko <kikocorreoso at gmail.com> wrote:

>
>
> 2015-09-24 23:59 GMT+02:00 Doug Blank <doug.blank at gmail.com>:
>
>> It isn't too complicated, if you can format your JavaScript in the kernel
>> language; here is JavaScript talking to Python:
>>
>> %%javascript
>> var javascript_var = 2 * 4 + 8;
>> IPython.notebook.kernel.execute("python_var = " + javascript_var);
>>
>> Hope that helps.
>>
>
> Hi Doug,
>
> It helps but it is not what I want.
>
> I want to access a object stored in the global js namespace of the
> browser. For instance, this is available in your js console on the browser
> when you work with IPython/Jupyter:
> *IPython.notebook.notebook_name*
>
> But if I do:
>
> *%%javascriptIPython.notebook.kernel.execute("python_var = " +
> IPython.notebook.notebook_name);*
>
> It doesn't work.
>

You have to construct valid Python with Javascript:

%%javascript
IPython.notebook.kernel.execute("python_var = '" +
IPython.notebook.notebook_name + "'");

(putting string in quotes). The suggestions to move from Javascript to
Python via JSON is a good one.


> In your example, where is *javascript_var* stored?
>

You can hang it off of window, or document.

-Doug




>
>
>> -Doug
>>
>>
>> On Thu, Sep 24, 2015 at 5:44 PM, Kiko <kikocorreoso at gmail.com> wrote:
>>
>>>
>>>
>>> 2015-09-24 23:41 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>>>
>>>>
>>>> On Sep 24, 2015 4:32 PM, "Kiko" <kikocorreoso at gmail.com> wrote:
>>>> >
>>>> > 2015-09-24 23:25 GMT+02:00 Wes Turner <wes.turner at gmail.com>:
>>>> >>
>>>> >> https://www.google.com/search?q=ipython+d3
>>>> >>
>>>> >> Vega visualization grammar
>>>> >> | Docs: https://github.com/vega/vega/wiki/Vega-and-D3
>>>> >> | Homepage: https://vega.github.io/
>>>> >>
>>>> >> mpld3: matplotlib + d3
>>>> >> | Homepage: http://mpld3.github.io/
>>>> >>
>>>> >> IPython widgets (interactive)
>>>> >> | Docs: https://github.com/ipython/ipython/wiki/widgets
>>>> >>
>>>> >> pythreejs IPython Notebook extension
>>>> >> | Src:
>>>> https://github.com/jovyan/pythreejs/blob/master/pythreejs/pythreejs.py
>>>> three.js
>>>> >> | Src:
>>>> https://github.com/jovyan/pythreejs/blob/master/pythreejs/nbextension/pythreejs.js
>>>> >>
>>>> >> * [ ] JSON-LD
>>>> >>    * http://json-ld.org/playground/
>>>> >
>>>> > Thanks.
>>>> >
>>>> > Yes, I think all of these allow you to send information from Python
>>>> to js but I'm talking about the opposite way. For instance, select an area
>>>> in an openlayers map and then get the coordinates of the area back to
>>>> Python.
>>>>
>>>> IIUC, that's more or less how widget controls operate.
>>>>
>>>> also, here's this:
>>>>
>>>> ipython-jsobject
>>>> Src: https://github.com/jdfreder/ipython-jsobject
>>>>
>>>>     JSON-LD (and/or e.g. CSVW) with RDFJS could be helpful:
>>>> https://github.com/rdfjs/rdfjs.org
>>>>      * https://github.com/rdfjs/rdfjs.org/wiki/Projects #LinkedData
>>>>      *
>>>> http://www.w3.org/community/rdfjs/wiki/Comparison_of_RDFJS_libraries
>>>>        * [ ] TODO: link these resources
>>>>
>>> Thanks, I will review that to check if I can obtain any hints.
>>>
>>>
>>>>
>>>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/d6488668/attachment.html>

From colyork at gmail.com  Thu Sep 24 21:24:43 2015
From: colyork at gmail.com (col)
Date: Fri, 25 Sep 2015 09:24:43 +0800
Subject: [IPython-dev] (no subject)
Message-ID: <CAE9rja_ni+Wa4Bm8yNH6xsKiY0CCtJUVDbX-rSYWGR5_hesT5g@mail.gmail.com>

I'm trying use a multi select widget to enable users to select from a list
of countries, and then have a widget button which, when clicked, runs all
the cells below.

This displays the list.

from IPython.display import display
w = widgets.SelectMultiple(

    description="Select up to five countries",
    options=dfCountries['name'].tolist()
)
display(w)

And I want something like this to run all cells below:

def run_all(button):
    get_ipython().run_cell()

button = widgets.Button(description="Create next input")
button.on_click(run_all)
display(button)

But I can't find the hook to 'run all cells below

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150925/0cfaa8ef/attachment.html>

From jon.freder at gmail.com  Fri Sep 25 01:22:02 2015
From: jon.freder at gmail.com (Jonathan Frederic)
Date: Thu, 24 Sep 2015 22:22:02 -0700
Subject: [IPython-dev] (no subject)
In-Reply-To: <CAE9rja_ni+Wa4Bm8yNH6xsKiY0CCtJUVDbX-rSYWGR5_hesT5g@mail.gmail.com>
References: <CAE9rja_ni+Wa4Bm8yNH6xsKiY0CCtJUVDbX-rSYWGR5_hesT5g@mail.gmail.com>
Message-ID: <CAAoBLw15qifupqv0p=oz2KEaFXpaHaVS3Y5f8rpYi7xyNeKsBw@mail.gmail.com>

Hi Col,

You'll need to use Javascript to accomplish that.  The following is a hack,
but should do the trick:

from IPython.display import Javascript, display
display(Javascript("""
var start = IPython.notebook.get_selected_index()-1;
for (var i = start+1; i < IPython.notebook.ncells(); i++) {
    IPython.notebook.get_cell(i).execute();
};
IPython.notebook.get_cell(start).clear_output;
"""))

Cheers,
Jon

On Thu, Sep 24, 2015 at 6:24 PM, col <colyork at gmail.com> wrote:

> I'm trying use a multi select widget to enable users to select from a list
> of countries, and then have a widget button which, when clicked, runs all
> the cells below.
>
> This displays the list.
>
> from IPython.display import display
> w = widgets.SelectMultiple(
>
>     description="Select up to five countries",
>     options=dfCountries['name'].tolist()
> )
> display(w)
>
> And I want something like this to run all cells below:
>
> def run_all(button):
>     get_ipython().run_cell()
>
> button = widgets.Button(description="Create next input")
> button.on_click(run_all)
> display(button)
>
> But I can't find the hook to 'run all cells below
>
> Thanks
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/2fc7e9a1/attachment.html>

From jon.freder at gmail.com  Fri Sep 25 01:23:51 2015
From: jon.freder at gmail.com (Jonathan Frederic)
Date: Thu, 24 Sep 2015 22:23:51 -0700
Subject: [IPython-dev] (no subject)
In-Reply-To: <CAAoBLw15qifupqv0p=oz2KEaFXpaHaVS3Y5f8rpYi7xyNeKsBw@mail.gmail.com>
References: <CAE9rja_ni+Wa4Bm8yNH6xsKiY0CCtJUVDbX-rSYWGR5_hesT5g@mail.gmail.com>
 <CAAoBLw15qifupqv0p=oz2KEaFXpaHaVS3Y5f8rpYi7xyNeKsBw@mail.gmail.com>
Message-ID: <CAAoBLw3PZ3PjV3Dnc-2Rte9-q9Nrw0i2R8BG=NO6SJft53YbKQ@mail.gmail.com>

Sorry, remove the -1 from the get_selected_index - that was because I was
using shift+enter to test.  It should be:

from IPython.display import Javascript, display
display(Javascript("""
var start = IPython.notebook.get_selected_index();
for (var i = start+1; i < IPython.notebook.ncells(); i++) {
    IPython.notebook.get_cell(i).execute();
};
IPython.notebook.get_cell(start).clear_output;
"""))

On Thu, Sep 24, 2015 at 10:22 PM, Jonathan Frederic <jon.freder at gmail.com>
wrote:

> Hi Col,
>
> You'll need to use Javascript to accomplish that.  The following is a
> hack, but should do the trick:
>
> from IPython.display import Javascript, display
> display(Javascript("""
> var start = IPython.notebook.get_selected_index()-1;
> for (var i = start+1; i < IPython.notebook.ncells(); i++) {
>     IPython.notebook.get_cell(i).execute();
> };
> IPython.notebook.get_cell(start).clear_output;
> """))
>
> Cheers,
> Jon
>
> On Thu, Sep 24, 2015 at 6:24 PM, col <colyork at gmail.com> wrote:
>
>> I'm trying use a multi select widget to enable users to select from a
>> list of countries, and then have a widget button which, when clicked, runs
>> all the cells below.
>>
>> This displays the list.
>>
>> from IPython.display import display
>> w = widgets.SelectMultiple(
>>
>>     description="Select up to five countries",
>>     options=dfCountries['name'].tolist()
>> )
>> display(w)
>>
>> And I want something like this to run all cells below:
>>
>> def run_all(button):
>>     get_ipython().run_cell()
>>
>> button = widgets.Button(description="Create next input")
>> button.on_click(run_all)
>> display(button)
>>
>> But I can't find the hook to 'run all cells below
>>
>> Thanks
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150924/d24d8b7a/attachment.html>

From vasco+python at tenner.nl  Fri Sep 25 03:54:02 2015
From: vasco+python at tenner.nl (Vasco)
Date: Fri, 25 Sep 2015 09:54:02 +0200
Subject: [IPython-dev] %matplotlib qt hangs notebook
Message-ID: <5604FD9A.5080500@tenner.nl>

Dear,
sometimes when I run %matplotlib qt in the ipython notebook (v4), it is 
indicated that the cell is executed and that the kernel is not busy. 
However, the next cell cannot be executed: there appears a *, as should 
be, but there is no output, the * remains, but the kernel does not look 
busy.

This mainly happens when I run the second cell, while the %matplotlib qt 
command is not finished yet.

Is this a known problem? How can I diagnose what is going on? I tried to 
start jupyter with --debug flag, but it does not give any errors or 
messages relating the notebook/kernel that is giving problems.

This problem occurs at both a windowsxp machine with the newest python3 
version from anaconda, as on a ubuntu machine, with
* python '3.4.0 (default, Jun 19 2015, 14:20:21) \n[GCC 4.8.2]'
* matplotlib 1.3.1

Both with ipython4 from pypi

Kind regards,
Vasco



From H.FANGOHR at soton.ac.uk  Fri Sep 25 04:30:49 2015
From: H.FANGOHR at soton.ac.uk (Fangohr H.)
Date: Fri, 25 Sep 2015 08:30:49 +0000
Subject: [IPython-dev] %matplotlib qt hangs notebook
In-Reply-To: <5604FD9A.5080500@tenner.nl>
References: <5604FD9A.5080500@tenner.nl>
Message-ID: <33175621-035E-4EDF-876C-52DF5AE3DF1F@soton.ac.uk>

Hi Vasco,

> On 25 Sep 2015, at 08:54, Vasco <vasco+python at tenner.nl> wrote:
> 
> Dear,
> sometimes when I run %matplotlib qt in the ipython notebook (v4), it is indicated that the cell is executed and that the kernel is not busy. However, the next cell cannot be executed: there appears a *, as should be, but there is no output, the * remains, but the kernel does not look busy.
> 
> This mainly happens when I run the second cell, while the %matplotlib qt command is not finished yet.
> 
> Is this a known problem? How can I diagnose what is going on? I tried to start jupyter with --debug flag, but it does not give any errors or messages relating the notebook/kernel that is giving problems.
> 
> This problem occurs at both a windowsxp machine with the newest python3 version from anaconda, as on a ubuntu machine, with
> * python '3.4.0 (default, Jun 19 2015, 14:20:21) \n[GCC 4.8.2]'
> * matplotlib 1.3.1
> 
> Both with ipython4 from pypi

I am not sure I follow all the details of your description, but I see similar behaviour on a OS X: when you request pop up windows from matplotlib via ?%matplotlib qt?, the window with the plot appears after you issue the pylon.show() or corresponding show() command. It so turns out that very often the window appears behind the other windows on the screen (i.e. behind the browser window in which the notebook runs), and thus I can?t see it easily. Only when I minimise the windows (F3 on the Mac), I can see the figure window. What happens is that this figure window has control of the process, thus the [*] in the cell containing the show() command. When I close the figure window, the [*] disappears from the cell and control goes back to the IPython notebook.

This may be what you see, or you may have another problem. If the [*] appears already when you enter only ?%matplotlib qt?, then your problem is likely to be different. 

[I generally prefer the ?%matplotlib inline? setting which includes figures inline.]

Best wishes,

Hans



> 
> Kind regards,
> Vasco
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev


From benjaminrk at gmail.com  Fri Sep 25 04:45:24 2015
From: benjaminrk at gmail.com (MinRK)
Date: Fri, 25 Sep 2015 10:45:24 +0200
Subject: [IPython-dev] %matplotlib qt hangs notebook
In-Reply-To: <33175621-035E-4EDF-876C-52DF5AE3DF1F@soton.ac.uk>
References: <5604FD9A.5080500@tenner.nl>
 <33175621-035E-4EDF-876C-52DF5AE3DF1F@soton.ac.uk>
Message-ID: <CAHNn8BX8oXy8mvOLtSvVRXi6NGz2fV8Pd5269BoCAvSk_LMmGw@mail.gmail.com>

There is a known issue with IPython 4 and Qt, which should be fixed in
master and released before too long.

-MinRK

On Fri, Sep 25, 2015 at 10:30 AM, Fangohr H. <H.FANGOHR at soton.ac.uk> wrote:

> Hi Vasco,
>
> > On 25 Sep 2015, at 08:54, Vasco <vasco+python at tenner.nl> wrote:
> >
> > Dear,
> > sometimes when I run %matplotlib qt in the ipython notebook (v4), it is
> indicated that the cell is executed and that the kernel is not busy.
> However, the next cell cannot be executed: there appears a *, as should be,
> but there is no output, the * remains, but the kernel does not look busy.
> >
> > This mainly happens when I run the second cell, while the %matplotlib qt
> command is not finished yet.
> >
> > Is this a known problem? How can I diagnose what is going on? I tried to
> start jupyter with --debug flag, but it does not give any errors or
> messages relating the notebook/kernel that is giving problems.
> >
> > This problem occurs at both a windowsxp machine with the newest python3
> version from anaconda, as on a ubuntu machine, with
> > * python '3.4.0 (default, Jun 19 2015, 14:20:21) \n[GCC 4.8.2]'
> > * matplotlib 1.3.1
> >
> > Both with ipython4 from pypi
>
> I am not sure I follow all the details of your description, but I see
> similar behaviour on a OS X: when you request pop up windows from
> matplotlib via ?%matplotlib qt?, the window with the plot appears after you
> issue the pylon.show() or corresponding show() command. It so turns out
> that very often the window appears behind the other windows on the screen
> (i.e. behind the browser window in which the notebook runs), and thus I
> can?t see it easily. Only when I minimise the windows (F3 on the Mac), I
> can see the figure window. What happens is that this figure window has
> control of the process, thus the [*] in the cell containing the show()
> command. When I close the figure window, the [*] disappears from the cell
> and control goes back to the IPython notebook.
>
> This may be what you see, or you may have another problem. If the [*]
> appears already when you enter only ?%matplotlib qt?, then your problem is
> likely to be different.
>
> [I generally prefer the ?%matplotlib inline? setting which includes
> figures inline.]
>
> Best wishes,
>
> Hans
>
>
>
> >
> > Kind regards,
> > Vasco
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > https://mail.scipy.org/mailman/listinfo/ipython-dev
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150925/9524552c/attachment.html>

From frandelapena at gmail.com  Fri Sep 25 04:46:47 2015
From: frandelapena at gmail.com (Francisco de la Pena)
Date: Fri, 25 Sep 2015 09:46:47 +0100
Subject: [IPython-dev] %matplotlib qt hangs notebook
In-Reply-To: <33175621-035E-4EDF-876C-52DF5AE3DF1F@soton.ac.uk>
References: <5604FD9A.5080500@tenner.nl>
 <33175621-035E-4EDF-876C-52DF5AE3DF1F@soton.ac.uk>
Message-ID: <1443170807.1653.90.camel@gmail.com>

I am experiencing the same issue that Vasco has reported. This notebook
 triggers the issue in IPython 4.0 in Anaconda linux 64. If the second
cell is executed before the execution of the first one (%matplolib
qt4), the kernel seems to hang.
Francisco
On Fri, 2015-09-25 at 08:30 +0000, Fangohr H. wrote:
> Hi Vasco,
> 
> > On 25 Sep 2015, at 08:54, Vasco <vasco+python at tenner.nl> wrote:
> > 
> > Dear,
> > sometimes when I run %matplotlib qt in the ipython notebook (v4),
> > it is indicated that the cell is executed and that the kernel is
> > not busy. However, the next cell cannot be executed: there appears
> > a *, as should be, but there is no output, the * remains, but the
> > kernel does not look busy.
> > 
> > This mainly happens when I run the second cell, while the
> > %matplotlib qt command is not finished yet.
> > 
> > Is this a known problem? How can I diagnose what is going on? I
> > tried to start jupyter with --debug flag, but it does not give any
> > errors or messages relating the notebook/kernel that is giving
> > problems.
> > 
> > This problem occurs at both a windowsxp machine with the newest
> > python3 version from anaconda, as on a ubuntu machine, with
> > * python '3.4.0 (default, Jun 19 2015, 14:20:21) \n[GCC 4.8.2]'
> > * matplotlib 1.3.1
> > 
> > Both with ipython4 from pypi
> 
> I am not sure I follow all the details of your description, but I see
> similar behaviour on a OS X: when you request pop up windows from
> matplotlib via ?%matplotlib qt?, the window with the plot appears
> after you issue the pylon.show() or corresponding show() command. It
> so turns out that very often the window appears behind the other
> windows on the screen (i.e. behind the browser window in which the
> notebook runs), and thus I can?t see it easily. Only when I minimise
> the windows (F3 on the Mac), I can see the figure window. What
> happens is that this figure window has control of the process, thus
> the [*] in the cell containing the show() command. When I close the
> figure window, the [*] disappears from the cell and control goes back
> to the IPython notebook.
> 
> This may be what you see, or you may have another problem. If the [*]
> appears already when you enter only ?%matplotlib qt?, then your
> problem is likely to be different. 
> 
> [I generally prefer the ?%matplotlib inline? setting which includes
> figures inline.]
> 
> Best wishes,
> 
> Hans
> 
> 
> 
> > 
> > Kind regards,
> > Vasco
> > 
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > https://mail.scipy.org/mailman/listinfo/ipython-dev
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150925/e4cfa31f/attachment.html>

From kikocorreoso at gmail.com  Sat Sep 26 07:29:01 2015
From: kikocorreoso at gmail.com (Kiko)
Date: Sat, 26 Sep 2015 13:29:01 +0200
Subject: [IPython-dev] Data from js to Python
In-Reply-To: <CAAusYCiyAwpw0gyos2o3sf7+UKyLAWpyS72Mzp-M5nBeyJjjnA@mail.gmail.com>
References: <CAB-sx62z21Z=sb1w+wesT1N_Azd-vu7=P=FUbjW92xVWRvA-sw@mail.gmail.com>
 <CABsfz4Jt0h8o1qYu_8SfGk1=FjYM=JnHc=3nGdWJg2Tcequd_g@mail.gmail.com>
 <CAB-sx61pNT+qdsugnutpHGWGDW1aPTv45JyirGH5=3_X_A6heg@mail.gmail.com>
 <CACfEFw8+-c_G4VEWk-aNA+vp0vwyBUB+Kgfa6L0w6xmG_2_7rg@mail.gmail.com>
 <CAB-sx63XOgU=SCGso+1tWhy9G_00MhrrQUyQL1NaG2sc_-MnFw@mail.gmail.com>
 <CACfEFw9uWP=UbgPhxQ8-eMORVEdqQgrX+=R3==jg-PaEhvXMxA@mail.gmail.com>
 <CAB-sx61eOTYCbh6wbgdqQOGsO795OY5RUqjj+3w6v8mvUoZk0A@mail.gmail.com>
 <CAAusYCiCe70iT0othybAni427UB=xu1h7kGD+VwC55o=pwvODw@mail.gmail.com>
 <CAB-sx606UQsGYNk6JyuNO-54ytCV7xvp5trtOtgrh4shnmh34Q@mail.gmail.com>
 <CAAusYCiyAwpw0gyos2o3sf7+UKyLAWpyS72Mzp-M5nBeyJjjnA@mail.gmail.com>
Message-ID: <CAB-sx60i9R3MW7Oh66LRxQbzB9EHutQ3-kMS_3NEboOP10hkxQ@mail.gmail.com>

2015-09-25 1:19 GMT+02:00 Doug Blank <doug.blank at gmail.com>:

> On Thu, Sep 24, 2015 at 6:34 PM, Kiko <kikocorreoso at gmail.com> wrote:
>
>>
>>
>> 2015-09-24 23:59 GMT+02:00 Doug Blank <doug.blank at gmail.com>:
>>
>>> It isn't too complicated, if you can format your JavaScript in the
>>> kernel language; here is JavaScript talking to Python:
>>>
>>> %%javascript
>>> var javascript_var = 2 * 4 + 8;
>>> IPython.notebook.kernel.execute("python_var = " + javascript_var);
>>>
>>> Hope that helps.
>>>
>>
>> Hi Doug,
>>
>> It helps but it is not what I want.
>>
>> I want to access a object stored in the global js namespace of the
>> browser. For instance, this is available in your js console on the browser
>> when you work with IPython/Jupyter:
>> *IPython.notebook.notebook_name*
>>
>> But if I do:
>>
>> *%%javascriptIPython.notebook.kernel.execute("python_var = " +
>> IPython.notebook.notebook_name);*
>>
>> It doesn't work.
>>
>
> You have to construct valid Python with Javascript:
>
> %%javascript
> IPython.notebook.kernel.execute("python_var = '" +
> IPython.notebook.notebook_name + "'");
>
> (putting string in quotes). The suggestions to move from Javascript to
> Python via JSON is a good one.
>
>
>> In your example, where is *javascript_var* stored?
>>
>
> You can hang it off of window, or document.
>

Great, now I better understand how it works.

Thanks, Doug and others for your time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150926/902f6e20/attachment.html>

From tabor at broadinstitute.org  Wed Sep 30 15:37:28 2015
From: tabor at broadinstitute.org (Thorin Tabor)
Date: Wed, 30 Sep 2015 15:37:28 -0400
Subject: [IPython-dev] Best way to get the path to the static directory
In-Reply-To: <CAHNn8BUCAFY99oh49V+N59iY_O3=MZjbZQLBVd81tx0Q5gGBBw@mail.gmail.com>
References: <55F1D48B.2070303@broadinstitute.org>
 <CAHNn8BUCAFY99oh49V+N59iY_O3=MZjbZQLBVd81tx0Q5gGBBw@mail.gmail.com>
Message-ID: <560C39F8.5000701@broadinstitute.org>

The extension is essentially a set of IPython widgets with some code to 
add a menu option to easily insert the widgets in a notebook. I have it 
working in IPython 3.2, and I'm trying to update it to Jupyter 4.

Here's how I currently have it working:

When the extension is loaded, I have code that checks for the necessary 
CSS and JS files, and then downloads them if they're not present. I do 
this through load_ipython_extension(). I then import them on the 
client-side using JQuery's $.getScript() for each of the files. One of 
the files contains the JavaScript code that adds the menu option.

I know that Jupyter 4 doesn't have profiles in the same way as IPython. 
I also know that the nbextension install mechanism you mentioned exists, 
but I don't know to (or if it is possible to) put downloaded files into 
it and serve them up to the client-side.

In Jupyter 4, I don't know to which directory it would be best to 
download the JS files. As mentioned, in IPython 3.2 this worked by 
downloading the files to the /static directory of the user's IPython 
profile, and then the notebook server would serve them up so that I 
could import them on the client-side using $.getScript(). This was nice 
because someone can install the extension through PIP, and then the 
extension puts all the necessary client-side stuff in place for the user 
when it's first executed. The user doesn't need to worry about any code 
beyond %load_ext.

Maybe the better question is: I want to serve up and execute an 
arbitrary number of JavaScript files in the notebook when our Python 
extension is loaded. What is the best way to do that?

Thorin

On 9/10/15 16:06, MinRK wrote:
>
> From a Python API, |custom.{js|css}| live in 
> |jupyter_core.paths.jupyter_config_dir() + '/custom'|. Note that you 
> probably shouldn?t be putting any files in there - if you are writing 
> javascript extensions, they should be placed in nbextensions via
>
> |jupyter nbextension install (4.x) or ipython install-nbextension (3.x) |
>
> -MinRK
>
> ?
>
> On Thu, Sep 10, 2015 at 9:05 PM, Thorin Tabor 
> <tabor at broadinstitute.org <mailto:tabor at broadinstitute.org>> wrote:
>
>     When writing a Jupyter notebook extension for Jupyter 4, what is
>     the recommended way to get the path to the static directory (you
>     know, the one where custom.js and custom.css are being served from)?
>
>     In Jupyter 3.x, you used to be able to reference...
>
>         IPython.utils.path.locate_profile() + '/static'
>
>     ...but that no longer seems to suffice. I know that...
>
>         notebook.notebookapp.DEFAULT_STATIC_FILES_PATH
>
>     looks like it might work, but it seems like there ought to be a
>     better way. Does anyone have a recommendation?
>
>     Thorin
>
>     _______________________________________________
>     IPython-dev mailing list
>     IPython-dev at scipy.org <mailto:IPython-dev at scipy.org>
>     http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150930/35f6f286/attachment.html>