How to wrap code/text in Jupyter notebooks

后端 未结 3 1252
傲寒
傲寒 2020-12-04 07:10

I am using jupyter-notebooks for python coding. Is there a way to wrap text/code in a jupyter notebook code cell?

Picture provided below.

By wrap

3条回答
  •  时光说笑
    2020-12-04 07:46

    In addition to Dan's answer, you can apply line wrapping for all cells (code or markdown) by specifying the top object as Cell. Adding the code below to your ~/.jupyter/nbconfig/notebook.json

    {
      "Cell": {
        "cm_config": {
          "lineWrapping": true
        }
      }
    }
    

    Ex: This is my cell config

    {
      "Cell": {
        "cm_config": {
          "lineNumbers": false,
          "lineWrapping": true
        }
      }
    }
    

提交回复
热议问题