最佳答案
通过jupyter –config-dir找到你的配置目录(我的是〜/ .jupyter)。然后编辑或创建nbconfig / notebook.json以添加以下内容:
{
"MarkdownCell": {
"cm_config": {
"lineWrapping": true
}
},
"CodeCell": {
"cm_config": {
"lineWrapping": true
}
}
}
(如果其中包含其他内容,请确保您拥有有效的JSON,并且后面没有逗号。)
重新启动Jupyter并重新加载您的笔记本。
相关文章
转载注明原文:如何在Jupyter笔记本中包装代码/文本 - 代码日志