title: Splitting strings within a list by commas while respecting parentheses
body: <p>I have a list such as</p>
  
  <pre><code>a = ['john(is,great),paul,school', 'robert,jack,john']
  </code></pre>
  
  <p>then I am building an empty list to append the split</p>
  
  <pre><code>b = []
  </code></pre>
  
  <p>then I do this </p>
  
  <pre><code>for i in a:
      b.append(i.split(','))
  </code></pre>
  
  <p>but list be is appearing like this</p>
  
  <pre><code>[['john(is', 'great)', 'paul', 'school'], ['robert', 'jack', 'john']]
  </code></pre>
  
  <p>It's doing this because it's splitting at the comma but is there another way to split this so that the output would be</p>
  
  <pre><code>['john(is,great)', 'paul', 'school', 'robert', 'jack', 'john']
  </code></pre>