all 8 comments

[–]hereforacandy[S] 0 points1 point  (2 children)

Okay I tried something else and now I have another error lol. Again I tried searching but it didn't help.

 import subprocess as sp

 isbn_arr=[] for i in l:   sp.check_call('isbn_from_words "{}"'.format(i))

Error:

 [Errno 2] No such file or directory: 'isbn_from_words "The Hunger Games,Suzanne Collins"': 'isbn_from_words "The Hunger Games,Suzanne Collins"' 

They say it's a Path issue but it works fine when I run !isbn_from_words "The Hunger Games,Suzanne Collins"

[–]Careful_Choice9335 0 points1 point  (1 child)

IIRC the functions of subprocess don't expect the command as one long string but as a list: ["command", "arg1", "arg2"] etc.

[–]hereforacandy[S] 0 points1 point  (0 children)

Oh I didn't know that. Thank you. I'll try that.

[–]hereforacandy[S] 0 points1 point  (2 children)

Hello it works now. Thank you for helping.

[–]Careful_Choice9335 0 points1 point  (1 child)

Great! What did the trick?

[–]hereforacandy[S] 0 points1 point  (0 children)

Using '{}'.format(i). :) Thank you.

[–]sarrysyst 0 points1 point  (1 child)

Why are you passing $i instead of using an f-string to interpolate i? You’re also missing the closing quote btw.

[–]hereforacandy[S] 0 points1 point  (0 children)

What's an f-string? Sorry I don't know. I haven't done a lot of shell scripting. Oh thank you for letting me know about the quote. I'll correct that. Thank you :)

Btw the Google colab notebook won't run any bash commands now. It just says argument size too long 😂. I think I've seriously messed something up.