Passing IPython variables as arguments to bash commands

后端 未结 3 492
失恋的感觉
失恋的感觉 2020-12-13 12:14

How do I execute a bash command from Ipython/Jupyter notebook passing the value of a python variable as an argument like in this example:

py_var=\"foo\"
!gre         


        
3条回答
  •  死守一世寂寞
    2020-12-13 12:49

    You cans use this syntax too:

    path = "../_data/"
    filename = "titanicdata.htm"
    ! less {path + filename}
    

提交回复
热议问题