This can become messy in a hurry, you may need to actually parse this line, and not just split it:
from pyparsing import (Forward,Suppress,Word,alphas,quotedString, alphanums,Regex,oneOf,Group,delimitedList)
Print
['school', 'department', ['classes', ['cost', '=', 15.0]], 'name'] [['school', ['size', '>', 10000]], ['department', ['school', 'type', '=', '"TECHNICAL"']], ['classes', ['cost', '=', 15.0]], 'name']
(It's easy to put "classes [cost = 15.00]" back together if you need to.)
source share