I am trying to pass an argument to a bash script I am running in Python using subprocess.run(). It is for a loop that runs the command passing in arguments from a list. I am using the Twint library but that part isn't important; I am pointing it out to make the question easier to answer. Currently, this is what I have
search_item = "bitcoin"
cmd = 'twint -s "%s" --limit 2000 --near "New York" -o file2.csv --csv' % (search_item)
p1 = subprocess.run( cmd , shell = True) % (search_item)
However on trying to run it, I get the error:
TypeError: unsupported operand type(s) for %: 'CompletedProcess' and 'str'
Any help on how I can pass the arguments? Thank you in advance