1

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
asked Jun 30, 2018 at 16:16
2
  • here i have an answer, can you try to use this approach stackoverflow.com/questions/50986354/… Commented Jun 30, 2018 at 16:25
  • thank you for the reply Druta, but I would like to stay in this convention if possible Commented Jun 30, 2018 at 16:36

1 Answer 1

0

Try this

python -c 'import os\
dict_name = {}\
dict_name["var1"]=1\
dict_name["var2"]=2\
'
answered Jun 30, 2018 at 16:25
Sign up to request clarification or add additional context in comments.

2 Comments

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.
for example dict_name["EXE"]=$exe_qespresso

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.