'how can merged byte string split to normal string
There is some data which stored improperly in the program, the original process will be like
a=b'abcd'
b=b'cded'
with open('text.txt','w') as wfp:
wfp.write(str(a))
wfp.write(str(b))
and sure the output string in text.txt becomes b'abcd'b'cded'
how can this perform a reverse operation that split and assign as two variables,
I tried to like this but not working, only return ['','','']
import re
with open('text.txt','r') as fp:
content = fp.read()
re.split("""b'\w+'""",content)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
