I have a string which is converted from a list like this:
"['station38', 'station28', 'station27', 'station1', 'station0']"
I want to split it by comma and become this:
list_str=['station38', 'station28', 'station27', 'station1', 'station0']
However I can only get this:
>>> line_stations = upstream_str.replace('[', '').replace(']', '').split(',')
["'station38'", "'station28'", "'station27'", "'station1'", "'station0'"]
And I have used strip('"')
, however it failed.
So how to get my favorite form? Thank for your reply.