title: How can I split a string of a mathematical expressions in python?
body: <p>I made a program which convert infix to postfix in python. The problem is when I introduce the arguments.
  If i introduce something like this: (this will be a string)</p>
  
  <pre><code>( ( 73 + ( ( 34 - 72 ) / ( 33 - 3 ) ) ) + ( 56 + ( 95 - 28 ) ) )
  </code></pre>
  
  <p>it will split it with .split() and the program will work correctly.
  But I want the user to be able to introduce something like this:</p>
  
  <pre><code>((73 + ( (34- 72 ) / ( 33 -3) )) + (56 +(95 - 28) ) )
  </code></pre>
  
  <p>As you can see I want that the blank spaces can be trivial but the program continue splitting the string by parentheses, integers (not digits) and operands.</p>
  
  <p>I try to solve it with a <code>for</code> but I don't know how to catch the whole number (73 , 34 ,72)  instead one digit by digit (7, 3 , 3 , 4 , 7 , 2)</p>
  
  <p>To sum up, what I want is split a string like <code>((81 * 6) /42+ (3-1))</code>  into:</p>
  
  <pre><code>[(, (, 81, *, 6, ), /, 42, +, (, 3, -, 1, ), )]
  </code></pre>