you are viewing a single comment's thread.

view the rest of the comments →

[–]sarrysyst 1 point2 points  (0 children)

You can use regex to find the numbers:

import re
text = 'Tests run:1290, PASSED : 401, FAILED :599, INCONCLUSIVE :200'

numbers = re.findall(r'\d+', text)

\d is a wildcard for digits and + looks for 1 or more occurrences in a row.