There is an interesting option in Ipython Jupyter Notebook to execute command line statements directly from the notebook. For example:
! mkdir ...
! python file.py
Moreover - this code can be run using os
:
import os
os.system('cmd command')
but how do I run interactive shell commands. For example:
!conda install package
may require future input ([Y]/N
) or folder location, but won't accept further input.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…