So as an example, I know that embedding python in bash as follows work:
python -c "import os
dict_name[\"var1\"]=1
dict_name[\"var2\"]=2
"
However, when I do the same exact thing in tcsh, I get the following error:
ERROR = Unmatched ".
Would anybody happen to have any insight on this? Would I have to python - c "" every line?
Thank you so much for your time.
Martin Tournoij
28k24 gold badges110 silver badges158 bronze badges
-
here i have an answer, can you try to use this approach stackoverflow.com/questions/50986354/…Druta Ruslan– Druta Ruslan2018年06月30日 16:25:21 +00:00Commented Jun 30, 2018 at 16:25
-
thank you for the reply Druta, but I would like to stay in this convention if possiblebsmith144– bsmith1442018年06月30日 16:36:34 +00:00Commented Jun 30, 2018 at 16:36
1 Answer 1
Try this
python -c 'import os\
dict_name = {}\
dict_name["var1"]=1\
dict_name["var2"]=2\
'
answered Jun 30, 2018 at 16:25
Sunitha
12.1k2 gold badges23 silver badges23 bronze badges
Sign up to request clarification or add additional context in comments.
2 Comments
bsmith144
Hi. While this seems to work, I do not think it is working correctly. For example, let's say that is 1= path to some executable. the executable should change color within the script, but under this convention, it remains red, making me think the name of the executable is simply a string.
bsmith144
for example dict_name["EXE"]=$exe_qespresso
lang-py