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: 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: >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 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: 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: References: <55F1D48B.2070303@broadinstitute.org> Message-ID: On Sep 10, 2015 3:06 PM, "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) > 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 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: 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: 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 to not restore these manpages. -MinRK ? -------------- next part -------------- An HTML attachment was scrubbed... URL: 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: References: Message-ID: (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 - attempting to edit malicious text files with invalid encoding can result in execution CVE-2015-7337 Thanks to Juan Broull?n, Jonathan Kamens, and Scott Sanderson for the reports. -MinRK ? -------------- next part -------------- An HTML attachment was scrubbed... URL: 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: 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: 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: References: Message-ID: 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 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: 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: References: Message-ID: 2015-09-24 22:17 GMT+02:00 Jacob Evans : > 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 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: 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: References: Message-ID: 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" wrote: > > > 2015-09-24 22:17 GMT+02:00 Jacob Evans : > >> 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 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: 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: References: Message-ID: 2015-09-24 23:25 GMT+02:00 Wes Turner : > 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" wrote: > >> >> >> 2015-09-24 22:17 GMT+02:00 Jacob Evans : >> >>> 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 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: 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: References: Message-ID: On Sep 24, 2015 4:32 PM, "Kiko" wrote: > > 2015-09-24 23:25 GMT+02:00 Wes Turner : >> >> 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" wrote: >>> >>> >>> >>> 2015-09-24 22:17 GMT+02:00 Jacob Evans : >>>> >>>> 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 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: 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: References: Message-ID: 2015-09-24 23:41 GMT+02:00 Wes Turner : > > On Sep 24, 2015 4:32 PM, "Kiko" wrote: > > > > 2015-09-24 23:25 GMT+02:00 Wes Turner : > >> > >> 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" wrote: > >>> > >>> > >>> > >>> 2015-09-24 22:17 GMT+02:00 Jacob Evans : > >>>> > >>>> 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 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: 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: References: Message-ID: "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" wrote: > > > 2015-09-24 23:41 GMT+02:00 Wes Turner : > >> >> On Sep 24, 2015 4:32 PM, "Kiko" wrote: >> > >> > 2015-09-24 23:25 GMT+02:00 Wes Turner : >> >> >> >> 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" wrote: >> >>> >> >>> >> >>> >> >>> 2015-09-24 22:17 GMT+02:00 Jacob Evans : >> >>>> >> >>>> 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 >> 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: 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: References: Message-ID: 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 wrote: > > > 2015-09-24 23:41 GMT+02:00 Wes Turner : > >> >> On Sep 24, 2015 4:32 PM, "Kiko" wrote: >> > >> > 2015-09-24 23:25 GMT+02:00 Wes Turner : >> >> >> >> 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: -------------- 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: 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: References: Message-ID: On Sep 24, 2015 4:59 PM, "Doug Blank" 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 wrote: >> >> >> >> 2015-09-24 23:41 GMT+02:00 Wes Turner : >>> >>> >>> On Sep 24, 2015 4:32 PM, "Kiko" wrote: >>> > >>> > 2015-09-24 23:25 GMT+02:00 Wes Turner : >>> >> >>> >> 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: 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: References: Message-ID: 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 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 wrote: > >> >> >> 2015-09-24 23:41 GMT+02:00 Wes Turner : >> >>> >>> On Sep 24, 2015 4:32 PM, "Kiko" wrote: >>> > >>> > 2015-09-24 23:25 GMT+02:00 Wes Turner : >>> >> >>> >> 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: 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: References: Message-ID: 2015-09-24 23:59 GMT+02:00 Doug Blank : > 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 wrote: > >> >> >> 2015-09-24 23:41 GMT+02:00 Wes Turner : >> >>> >>> On Sep 24, 2015 4:32 PM, "Kiko" wrote: >>> > >>> > 2015-09-24 23:25 GMT+02:00 Wes Turner : >>> >> >>> >> 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: 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: References: Message-ID: On Thu, Sep 24, 2015 at 6:34 PM, Kiko wrote: > > > 2015-09-24 23:59 GMT+02:00 Doug Blank : > >> 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 wrote: >> >>> >>> >>> 2015-09-24 23:41 GMT+02:00 Wes Turner : >>> >>>> >>>> On Sep 24, 2015 4:32 PM, "Kiko" wrote: >>>> > >>>> > 2015-09-24 23:25 GMT+02:00 Wes Turner : >>>> >> >>>> >> 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: 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: 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: 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: References: Message-ID: 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 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: 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: References: Message-ID: 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 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 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: 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 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: 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. wrote: > Hi Vasco, > > > On 25 Sep 2015, at 08:54, Vasco 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: 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 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: 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: References: Message-ID: 2015-09-25 1:19 GMT+02:00 Doug Blank : > On Thu, Sep 24, 2015 at 6:34 PM, Kiko wrote: > >> >> >> 2015-09-24 23:59 GMT+02:00 Doug Blank : >> >>> 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: 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: References: <55F1D48B.2070303@broadinstitute.org> 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 > > 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: