Alright, Currently, if given a string like such:
A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5,(F:0.6,G:0.7)H:0.8
I am using this:
child = Pstring[Pstring.find('(')+1:Pstring.find(')')]
To iterate through the string, and print out the inner parenthesis, and assign it to the variable 'child'
Now, my question is, how can I do the same for:
W:1.0,X:1.1(A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5,(F:0.6,G:0.7)H:0.8)Y:0.9
Which just simply contains an outside parenthesis to show that everything(except W and X) are children of Y
I currently get an output of 'child' as:
A:0.1,B:0.2,(C:0.3,D:0.4
Whereas what I want the code to do is to first parse through the outside parenthesis, and grab the inner ones first, then work on the outside last.
Thanks!