只要在一个code cell中加入下面代码即可
from IPython.display import display
from IPython.display import HTML
import IPython.core.display as di
di.display_html('<script>jQuery(function() {if (jQuery("body.notebook_app").length == 0) { jQuery(".input_area").toggle(); jQuery(".prompt").toggle();}});</script>', raw=True)
CSS = """#notebook div.output_subarea {max-width:100%;}""" #changes output_subarea width to 100% (from 100% - 14ex)
HTML('<style>{}</style>'.format(CSS))
参考网址:https://www.jianshu.com/p/ce873d5709bb
这段代码在Jupyter Notebook中实现了一个功能,通过引入jQuery,实现输入区域和提示信息的显示与隐藏控制,并调整了输出子区域的宽度为100%。适合于调整Notebook的显示样式。
2285

被折叠的 条评论
为什么被折叠?



