you can use a function re.sub in re library
for example:
data = re.sub('0123456789abcdefghijklmnopqrstuvwxyzQWERTYUIOPASDFGHJKLZXCVBNNM+/-', '', data)
this will keep every character in the first paramiter replace with the secound parameter by using String from the third paramiter
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…