# JupyterLab Dictionary Content Output Format

**URL:** <https://discourse.jupyter.org/t/jupyterlab-dictionary-content-output-format/5863>\
**Category:** JupyterLab\
**Created:** [September 4, 2020, 3:08pm UTC](https://discourse.jupyter.org/t/jupyterlab-dictionary-content-output-format/5863 "2020-09-04T15:08:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [September 4, 2020, 8:26pm UTC](https://discourse.jupyter.org/t/jupyterlab-dictionary-content-output-format/5863/2 "2020-09-04T20:26:57Z")

</div>

> [@Ourkid123uk](#):
>
> How do i get “JupyterLab” to output the contents of the dictionary the same format as “Spyder” does, all on a single line? Or at least each keys list completely on each keys line.

There isn’t a true line break in the JupyterLab display. Zoom out in your browser and you should see the output of `print(people)` on one line. In Chrome, `Zoom out` is under `View`.

The following in the notebook will get closer to listing each key per line but still fails with `email` key in your provided example:

```python
display(people)

```

But if you need to control display in Jupyter there may be other ways to accomplish what you seek? For example you can add in a little lightweight python code to do better handle things as you want. For example the following will place ’ keys list completely on each keys line’ as long as your JupyterLab window isn’t too narrow:

```python
from IPython.display import Markdown, display
def printmd(string):
    display(Markdown(string))
printmd(str(people).replace("],","], \n"))

```

With that code in Jupyter, you’ll see as output:

```plaintext
{'first': ['Corey', 'Jane', 'John'],
'last': ['Shafer', 'Doe', 'Millard'],
'email': ['CoreyMSchafer@gmail.com', 'JaneDoe@email.com', 'JohnM81@hotmail.com']}

```

(I employ that `printmd()` function in other answers [here](https://discourse.jupyter.org/t/how-to-add-markdown-inside-a-function-to-pretty-print-equation/2719/2) and [here](https://discourse.jupyter.org/t/display-command-output-as-math-ipython-display-math/3125/2). Relying on the output now being markdown, I added in some [markdown syntax](https://daringfireball.net/projects/markdown/) to the string representation of the dictionary to control displaying parts more.)

---

_[View the full topic](https://discourse.jupyter.org/t/jupyterlab-dictionary-content-output-format/5863)._
