A="[[sd, HTTF, g], [sd, HTTF, g]]"
How to this list
CodePudding user response:
What was the outcome of the transformation?
Changing all simple string list is easy to list (a)
CodePudding user response:
feel you didn't describe clearly, please post a problem or the topic all of text, CodePudding user response:
The letter is inside the string?
CodePudding user response:
The import re
S="[[sd, HTTF, g], [sd, HTTF, g]]"
S=eval (re. Sub (" (? P
\ w +) ", lambda x: repr (x.g roup (" value ")), s))
Print (s [0] [0])
CodePudding user response:
A="[[sd, HTTF, g], [sd, HTTF, g]]"
This will convert to
A=[[' sd ', 'HTTF', 'g'], [' sd ', 'HTTF', 'g']] CodePudding user response: