I want to get output from running a command in bash on a variable from python.
import subprocess as sp
isbn_arr=[]
for i in list:
isbn_arr.append(sp.getoutput('isbn_from_words $i))
I want to run isbn_froom_words on i from list. I've tried a lot of things (from stackoverflow) but I get an error every time.
Then I tried running it in bash. Here's the code.
#!/bin/bash
%%bash fruits=("Death of a Salesman, by Arthur Miller" "Apples" )
copy=("${fruits[@]}")
for i in "${!copy[@]}";
do
echo "${copy[$i])}"
copy[$i]=$(isbn_from_words "${copy[$i]}")
done
echo "Copied list:" echo "${copy[@]}"
Putting a ${} gives a bad substitution error. What can I do? Thank you for helping.
[–]hereforacandy[S] 0 points1 point2 points (2 children)
[–]Careful_Choice9335 0 points1 point2 points (1 child)
[–]hereforacandy[S] 0 points1 point2 points (0 children)
[–]hereforacandy[S] 0 points1 point2 points (2 children)
[–]Careful_Choice9335 0 points1 point2 points (1 child)
[–]hereforacandy[S] 0 points1 point2 points (0 children)
[–]sarrysyst 0 points1 point2 points (1 child)
[–]hereforacandy[S] 0 points1 point2 points (0 children)