[How to run the .ipynb script under the terminal terminal of the Mac system]

How to run the .ipynb script under the terminal terminal of the Mac system

method 1

  • Use the command operation in the terminal:

    runipy test.ipynb  ##可直接运行该脚本
    
    runipy -o test.ipynb  ## 可查看每一个cell的输出结果
    
    runipy test.ipynb --html res_0704.html ## 将所有输出结果保存为html格式
    
    • Before executing the above instructions, you need to install the package according to the following instructions
    • pip3 install runipy
  • insert image description here

  • insert image description here

Method 2

  • Can be operated directly using ipython

    ipython -c "%run test.ipynb"
    

Method 3

  • Can be opened directly using jupyter notebook in anaconda

Guess you like

Origin blog.csdn.net/crist_meng/article/details/125604719