Purpose : I want to select a list of unicode-encoded strings through findall (there are tuples in the list)
Problem: Error [TypeError: expected string or buffer]
Now test:
define a list of tuples
My previous purpose was to filter the output value after findall again, and execute findall directly, resulting in an error
which is:
Solution:
In the end, I found that it is actually very simple, that is , the text parameter found by findall should be of string type, and the output of findall is a list type, so taking the list to the second findall to find the text parameter will report an error.
list = re.findall(x, string)
So just convert the list to a string