first=re.findall('\d+', data)
first=re.findall('(\d+)\n\nsecond', data)
>>> import re
>>>
>>> text = """
... abc
... first:
... 10, 20, 30, 40, 50
...
... def
... second:
... 600, 700, 800, 900, 1000
...
... ghi
... """
>>>
>>> list(map(re.compile(r'\d+').findall,
... re.findall(r'(?:\d+(?:, )?)+', text)))
[['10', '20', '30', '40', '50'], ['600', '700', '800', '900', '1000']]
>>>
next_line_is_first, next_line_is_second = False, False
first, second = [], []
for line in file:
if next_line_is_first:
first = line.split(,)
next_line_is_first = False
if next_line_is_second:
second = line.split(,)
next_line_is_second = False
if 'first:' in line:
next_line_is_first = True
if 'second:' in line:
next_line_is_second = True
print first, second