标签: python jupyter-notebook
在jupyter notebook中,我们可以使用感叹号执行shell命令,例如:
jupyter notebook
!ls *.png
我正在寻找一种将参数传递给该命令的方法,例如:
extention='*.png' !ls %extention
我知道可以使用os.system或subprocess.check_output,但是我想使用感叹号,因为这会给我实时输出。
答案 0 :(得分:1)
可以使用{},例如:
{}
extention='*.png' !ls {extention}