with regex
>>> import re
>>> s = "(5, 42) (20, -32)"
>>> x1, y1, x2, y2 = map(int, re.match(r"\((.*), (.*)\) \((.*), (.*)\)", s).groups())
>>> x1, y1
(5, 42)
>>> x2, y2
(20, -32)
or without regex
>>> x1, y1, x2, y2 = (int(x.strip("(),")) for x in s.split())