import re
s = "PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aG"
s = re.sub(r"(.{8})", "\\1\r\n", s)
print(s)
运行结果:
PCFET0NU
WVBFIGh0
bWw+Cjxo
dG1sPgo8
aG
Process finished with exit code 0
import re
s = "PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aG"
s = re.sub(r"(.{8})", "\\1\r\n", s)
print(s)
运行结果:
PCFET0NU
WVBFIGh0
bWw+Cjxo
dG1sPgo8
aG
Process finished with exit code 0