Magic开关分为两大类:%line magic & %%cell magic
%quickref
%lsmagic
%config ZMQInteractiveShell.ast_node_interactivity='all'#设置这个的目的就是让cell中的结果全部输出显示
%pprint
%config ZMQInteractiveShell.ast_node_interactivity='all'
a = 2
n = 4
a
n
输出显示
2
4
%%html
print('this is python3')
<hr>
%%writefile test.py
for item in range(10):
print(item)
命令行,执行程序:
!python test.py
%%timeit 100
for item in range(10):
a = item
del a
Jupyter notebook扩展安装
!python -m pip install jupyter_contrib_nbextensions