from itertools import groupby
s = 'HPO:0000234'
ss = [''.join(list(g)) for k, g in groupby(s, key=lambda x: x.isdigit())]
print(ss)
from itertools import groupby
s = 'HPO:0000234'
ss = [''.join(list(g)) for k, g in groupby(s, key=lambda x: x.isdigit())]
print(ss)