Here is a way
def parse(annotation):
return list((int(x), int(y)) for (x,y) in (item.strip(" ()").split('..') for item in annotation.split(',')))
print parse('(1834..2736), (348..7734)')
""" my output -->
[(1834, 2736), (348, 7734)]
"""
Edit: try and use the[code] button in the editor window at the bottom of this page!
Edit: it seems that pyTony gave you another nice solution last month http://www.daniweb.com/software-development/python/threads/400630/1715515#post1715515
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691