import locale
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
my_str = '(4,301)'
result = -locale.atoi(my_str.translate(None, '()'))
Convert a number enclosed in parentheses (string) to a negative integer (or float) using Python?