This works:
Code:
from subprocess import run, PIPE
output="""
[
"Str1",
"Str2"
]"""
output_string = output.strip()
bad_chars = '(){}<>[]," '
for c in bad_chars:
output_string = output_string.replace(c, "")
#https://stackoverflow.com/questions/3900054/python-strip-multiple-characters
results = list()
results.extend(s for s in output_string.split('\n') if s.strip())
print(results)
The first mistake was assigning the results of the replace method (which returns a new string) to "s".
That said, you said the string was only "JSON-like", but in you're code sample it's actually valid JSON. So the Pythonic approach would have been this:
Code:
import json
output="""
[
"Str1",
"Str2"
]"""
print(json.loads(output))