[IPython-dev] Getting the size of ipython notebook cell
Matthias Bussonnier
bussonniermatthias at gmail.com
Mon Jul 7 15:37:51 EDT 2014
Hi Benjamin,
Le 7 juil. 2014 à 21:27, bjonen a écrit :
> Hey giuys,
>
> I am working on a patch for pandas that allows a dataframe's string
> representation to scale with the height and width of the terminal.
> It would be nice to make this possible in the ipython notebook also.
> However, for this I would need a way to infer the current size of a cell in
> the notebook to cut the dataframe appropriately.
>
> Anybody know a way to do this?
To add to thomas answer :
As for anythings related to knowing something related to the frontend, it is not possible
with IPython protocol.
- The kernel does not know is is connected to a notebook.
- The notebook can be run headless (width make no sense)
- several notebook can window can be connected at the same give with live sync between them (so width not unique)
[ might be anticipating tomorrow (today?) announcement as scipy]
- Window can be resized ....
- notebook displayed in nbviewer
And so on, and so forth.
The only thing you can try to if you want dynamic things is to use dynamic table with javascript/html.
--
M
>
> For completeness, here the link to the corresponding pandas issue:
> https://github.com/pydata/pandas/issues/7180#issuecomment-47335444
>
> Thanks,
> Benjamin
>
>
>
> --
> View this message in context: http://python.6.x6.nabble.com/Getting-the-size-of-ipython-notebook-cell-tp5063264.html
> Sent from the IPython - Development mailing list archive at Nabble.com.
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
More information about the IPython-dev
mailing list