小编Ali*_*ine的帖子

Jupyter 笔记本感叹号参数

在 中jupyter notebook,我们可以使用感叹号执行 shell 命令,例如:

!ls *.png
Run Code Online (Sandbox Code Playgroud)

我正在寻找一种将参数传递给该命令的方法,例如:

extention='*.png'
!ls %extention
Run Code Online (Sandbox Code Playgroud)

我知道使用os.systemsubprocess.check_output可以做到这一点,但我想使用感叹号,因为这会给我实时输出。

python jupyter-notebook

2
推荐指数
1
解决办法
1478
查看次数

标签 统计

jupyter-notebook ×1

python ×1