我想在 Jupyter 中执行一个 python 脚本,但我不想使用网络浏览器(IPython 交互式终端),我想在 Linux 终端中运行一个命令来加载和运行 python 脚本,所以我可以从 Jupyter 获得输出。
我尝试运行 jupyter notebook %run <my_script.py>
, 但似乎 jupyter 无法识别 %run
变量。
这有可能吗?
最佳答案
jupyter_client
包有一个 jupyter run
命令,因为 v5.0 ,所以你可以这样做:
jupyter run my_script.py
关于python - 如何在终端中的 Jupyter 上运行 python 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36839650/