These are chat archives for ipython/ipython

3rd
Jul 2015
Min RK
@minrk
Jul 03 2015 00:04
@CarlCochran that's definitely not supposed to be happening. I will investigate.
Peter Parente
@parente
Jul 03 2015 19:22
is it possible to get the notebook_dir setting value from within a notebook?
Min RK
@minrk
Jul 03 2015 19:25
No, kernels are not aware that notebooks are running at all.
Why?
Peter Parente
@parente
Jul 03 2015 19:27
looking to write a magic that takes action starting at the root of the notebook dir
i can always pass it or read it from a well-known location (env var, active profile). just wondering if there was something pre-existing
Min RK
@minrk
Jul 03 2015 19:29
notebook servers do write a json file with this info.
In 3.0, it's IPYTHON_PROFILE/security/nbserver-PID.json. In 4.0, it'll be JUPYTER_RUNTIME_DIR/nbserver-PID.json
in Python, those are accessible as IPython.utils.path.locate_profile() and jupyter_core.paths.jupyter_runtime_dir(), respectively.
Peter Parente
@parente
Jul 03 2015 19:32
I see the file. neat. thanks.
Răzvan Cosmin Rădulescu
@razvanc-r
Jul 03 2015 22:42
guys, is it possible to have the notebook update as you work with the kernel from another frontend? say for example qtconsole or something else?...
Min RK
@minrk
Jul 03 2015 23:01
Not really, no.
Răzvan Cosmin Rădulescu
@razvanc-r
Jul 03 2015 23:02
then... is it possible to get the last code sent to the kernel from another source like the qtconsole?
Min RK
@minrk
Jul 03 2015 23:08
Yes, in IPython that's typically In[-2]
Răzvan Cosmin Rădulescu
@razvanc-r
Jul 03 2015 23:13
hm, seems to work... thanks
Min RK
@minrk
Jul 03 2015 23:15
It might be more logical to be -1, but IPython caches the current input before executing, so In[-1] is always the current cell.
Răzvan Cosmin Rădulescu
@razvanc-r
Jul 03 2015 23:15
I've noticed...