Notebooks: Passing string variables as arguments to python script via command line(!), using quotes And $, eg -arg1 '$varible1'
问题 In using variables in the command line from a notebook cell, I saw that we can use put a $ in front of the variable, or surround the variable using {} , for example !command {variable} or !command $variable But when I was running a python script using the command line from a notebook cell, I would get errors variable1 = '/path/to/directory' variable2 = 7 !Script.py -arg1 $variable1 -arg2 $variable2 and !Script.py -arg1 {variable1} -arg2 {variable2} did not work. After experimenting a little