If your nested strings are in the form of '"A","B","C"', you can use the following:
s.split('"')[1::2] split by double quote, only odd indices (i.e. between quotes)
If you want a nested list, you can use this expression inside a list comprehension, like this:
[s.split('"')[1::2] for s in thelist]
where thelist is the original list.
Why only odd indices? It comes from the structure of the string:
0th element of split() result would be part of the string before 1st quote;
1st - between the 1st and 2nd quotes;
2nd - between the 2nd and 3rd, and so on.
We need only the strings between odd (opening) and even (closing) quotes.
Example:
t = ['"1","2","3","4"', '"5","6","7',"8"']
a = [s.split('"')[1::2] for s in t]
print(a)
prints
[['1','2','3','4'],['5','6','7','8']]
[[word.strip('"')] for word in inputlist]would do that. This is rather a broad question if you are talking about doing this in general."'foo','bar'"? If so, you probably wantast.literal_eval, as that will convert multiple comma separated strings into a tuple.