I have a list of paragraphs like this:
list1 = [
"something",
"more",
...
"{ //image// }"
"something"
...
"{ //image// }"
...
]
The "{ //image// }" text occurs a known amount in the list. I have another list with paths to images which has the same length as the amount of occurrences of the text:
list2 = [
"path1",
"path2"
]
Now I am working with pyqt and I want to show all the elements of the first list in a QLabel. I am doing this like that:
paragraphs = ""
for element in list1:
elements += element + "<br>"
my_QLabel.setText(elements)
Now I want to replace every occurrence of the String { //image// } in the QLabel with an image from the second list. How can I do that while still keeping the other text?